Posix Tests Compiler Warnings

Gedare Bloom gedare at rtems.org
Wed Aug 21 12:59:47 UTC 2013


Hi,

The documentation you pointed to is the Linux kernel doc, which are
not entirely relevant for RTEMS. Is there a POSIX standard that
governs this issue?

This looks like mostly converting pointer types to long unsigned int?
Some of the changes seem like they should not be necessary, like:
-    printf(  "...st_blksize %" PRIxblksize_t "\n", statbuf.st_blksize );
-    printf(  "...st_blocks  %" PRIxblkcnt_t "\n", statbuf.st_blocks );
+    printf(  "...st_blksize %" PRIxblksize_t "\n", (long unsigned
int)statbuf.st_blksize );
+    printf(  "...st_blocks  %" PRIxblkcnt_t "\n", (long unsigned
int)statbuf.st_blocks );

Here the printf already should accommodate the size of the type of the
blksize_t and blkcnt_t. This is how I usually see this issue of
variably-sized types being printed. I don't know the right answer.

-Gedare

On Wed, Aug 21, 2013 at 12:33 AM, Rempel, Cynthia
<cynt6007 at vandals.uidaho.edu> wrote:
> Hi,
>
> Reducing the number of unnecessary compiler warnings makes it easier to find (and fix) real compiler warnings...
>
> The fix is in accordance with:
>
> https://www.kernel.org/doc/Documentation/printk-formats.txt
> If <type> is dependent on a config option for its size (e.g., sector_t,
> blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
> format specifier of its largest possible type and explicitly cast to it.
>
> This patch reduces the number of posix tests compiler warnings, by recasting arguments in printf statements...
>
> Thanks,
> Cynthia Rempel
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel
>



More information about the devel mailing list