diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-02-19 23:27:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-02-19 23:27:40 +0100 |
commit | cca615afc0ba4f42c57636c910ffb0d3a5c3a169 (patch) | |
tree | ca2875d388e570e95882bcfda1b550dd08df156b /gcc/testsuite/c-c++-common/pr37743.c | |
parent | 9254148e5b99e09b9f1da76f74a42bed3d88a2dc (diff) | |
download | gcc-cca615afc0ba4f42c57636c910ffb0d3a5c3a169.zip gcc-cca615afc0ba4f42c57636c910ffb0d3a5c3a169.tar.gz gcc-cca615afc0ba4f42c57636c910ffb0d3a5c3a169.tar.bz2 |
re PR c/37743 (Bogus printf format warning with __builtin_bswap32.)
PR c/37743
* c-common.c (c_common_nodes_and_builtins): When initializing
c_uint{16,32,64}_type_node, also set corresponding
uint{16,32,64}_type_node to the same value.
* g++.dg/ext/builtin-bswap1.C: New test.
* c-c++-common/pr37743.c: New test.
From-SVN: r207924
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr37743.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/pr37743.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr37743.c b/gcc/testsuite/c-c++-common/pr37743.c new file mode 100644 index 0000000..2ea678e --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr37743.c @@ -0,0 +1,13 @@ +/* PR c/37743 */ +/* This needs to be run only on targets where __UINT32_TYPE__ is defined + to unsigned int. */ +/* { dg-do compile { target *-*-linux-gnu* } } */ +/* { dg-options "-Wformat" } */ + +int foo (const char *, ...) __attribute__ ((format (printf, 1, 2))); + +void +bar (unsigned int x) +{ + foo ("%x", __builtin_bswap32 (x)); +} |