Bug 52732 - __builtin_bswapXX doesn't work with printf format
Summary: __builtin_bswapXX doesn't work with printf format
Status: RESOLVED DUPLICATE of bug 37743
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-26 22:06 UTC by H.J. Lu
Modified: 2012-03-27 07:43 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.6.3, 4.7.0, 4.8.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2012-03-26 22:06:44 UTC
Somehow, GCC gets very confused:

[hjl@gnu-6 gcc]$ cat /tmp/f.c
#include <stdio.h>

void
foo (int x, long y)
{
  printf ("%u\n", __builtin_bswap32 (x));
  printf ("%u\n", x);
  printf ("%lu\n", __builtin_bswap64 (x));
  printf ("%lu\n", y);
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -Wall -c /tmp/f.c
/tmp/f.c: In function ‘foo’:
/tmp/f.c:6:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat]
/tmp/f.c:8:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
[hjl@gnu-6 gcc]$
Comment 1 joseph@codesourcery.com 2012-03-26 22:14:01 UTC
See bug 37743.
Comment 2 Richard Biener 2012-03-27 07:43:36 UTC
.

*** This bug has been marked as a duplicate of bug 37743 ***