[ 
https://issues.apache.org/jira/browse/MYNEWT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15891382#comment-15891382
 ] 

ASF subversion and git services commented on MYNEWT-650:
--------------------------------------------------------

Commit a4df93c102a6d4d0a4d6896af704bd7c1d2ebff6 in incubator-mynewt-core's 
branch refs/heads/develop from [~ccollins476]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-mynewt-core.git;h=a4df93c 
]

MYNEWT-650 fs/fs/test build errors for non-native

The problem is that the fixed-size integer types map to different
"natural" integer types, depending on the target platform.
Unfortunately, the PRIxxx macros in inttypes.h don't work here, since
gcc assumes no cross compile when it generates the warning. The next
best solution is to cast everything to uintmax_t and apply the j format
specifier.


> fs/fs/test build errors for non-native platforms
> ------------------------------------------------
>
>                 Key: MYNEWT-650
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-650
>             Project: Mynewt
>          Issue Type: Bug
>            Reporter: Christopher Collins
>            Assignee: Christopher Collins
>             Fix For: v1_0_0_rel
>
>
> E.g.,
> {noformat}
> fs/nffs/test/src/nffs_test_debug.c:68:12: error: format '%d' expects argument 
> of type 'int', but argument 5 has type 'uint32_t' [-Werror=format=]
>             inode.ni_seq, inode.ni_inode_entry->nie_flags);
>             ^
> fs/nffs/test/src/nffs_test_debug.c: In function 'print_nffs_flash_inode':
> fs/nffs/test/src/nffs_test_debug.c:112:12: error: format '%x' expects 
> argument of type 'unsigned int', but argument 2 has type 'uint32_t' 
> [-Werror=format=]
>             filename);
>             ^
> fs/nffs/test/src/nffs_test_debug.c:112:12: error: format '%x' expects 
> argument of type 'unsigned int', but argument 4 has type 'uint32_t' 
> [-Werror=format=]
> fs/nffs/test/src/nffs_test_debug.c:112:12: error: format '%x' expects 
> argument of type 'unsigned int', but argument 7 has type 'uint32_t' 
> [-Werror=format=]
> fs/nffs/test/src/nffs_test_debug.c:112:12: error: format '%x' expects 
> argument of type 'unsigned int', but argument 8 has type 'uint32_t' 
> [-Werror=format=]
> fs/nffs/test/src/nffs_test_debug.c: In function 'print_nffs_flash_block':
> fs/nffs/test/src/nffs_test_debug.c:132:12: error: format '%x' expects 
> argument of type 'unsigned int', but argument 2 has type 'uint32_t' 
> [-Werror=format=]
>             ndb.ndb_inode_id);
> {noformat}
> The problem is that the fixed-size integer types map to different "natural" 
> integer types, depending on the target platform.  Unfortunately, the PRIxxx 
> macros in inttypes.h don't work here, since gcc assumes no cross compile when 
> it generates the warning.  The next best solution is to cast everything to 
> uintmax_t and apply the {{j}} format specifier.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to