You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "Christopher Collins (JIRA)" <ji...@apache.org> on 2017/03/02 00:55:45 UTC

[jira] [Resolved] (MYNEWT-650) fs/fs/test build errors for non-native platforms

     [ https://issues.apache.org/jira/browse/MYNEWT-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Collins resolved MYNEWT-650.
----------------------------------------
    Resolution: Fixed

> 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)