This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37743] Bogus printf format warning with __builtin_bswap32.
- From: "jyasskin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 May 2012 20:45:33 +0000
- Subject: [Bug c/37743] Bogus printf format warning with __builtin_bswap32.
- Auto-submitted: auto-generated
- References: <bug-37743-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37743
Jeffrey Yasskin <jyasskin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jyasskin at gcc dot gnu.org
--- Comment #7 from Jeffrey Yasskin <jyasskin at gcc dot gnu.org> 2012-05-01 20:45:33 UTC ---
This also causes the result of __builtin_bswap32 to fail overload resolution:
$ cat test.cc
void foo(unsigned int x);
void foo(int x);
void bar(long long x) {
foo(__builtin_bswap32(x));
}
$ g++-4.8pre -c test.cc
test.cc: In function âvoid bar(long long int)â:
test.cc:5:27: error: call of overloaded âfoo(unsigned int)â is ambiguous
test.cc:5:27: note: candidates are:
test.cc:1:6: note: void foo(unsigned int)
test.cc:2:6: note: void foo(int)
$ g++-4.8pre --version
g++-4.8pre (GCC) 4.8.0 20120330 (experimental)
It's not terribly important to me: a wrapper can easily cast to the expected
type.