Open Quuxplusone opened 9 years ago
Bugzilla Link | PR22949 |
Status | NEW |
Importance | P normal |
Reported by | Lubomir Rintel (lkundrak@v3.sk) |
Reported on | 2015-03-18 11:32:44 -0700 |
Last modified on | 2015-03-18 11:40:15 -0700 |
Version | 3.5 |
Hardware | PC Linux |
CC | dblaikie@gmail.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
This doesn't look like the output of clang (clang's diagnostics quote the
original source, not the post-processed source). Did you run this through the
preprocessor manually before giving it to clang?
Not sure how else you'd get that output...
(could you provide a standalone reproduction?)
I don't get a missing-prototype warning for the original source code you gave:
$ cat tmp.c
#include <sys/wait.h>
void f () { if (WIFCONTINUED(0)) return; }
$ clang-tot -Weverything -c tmp.c
tmp.c:2:6: warning: no previous prototype for function 'f' [-Wmissing-
prototypes]
void f () { if (WIFCONTINUED(0)) return; }
^
1 warning generated.
If you use --save-temps, then you get the behavior you reported - perhaps
that's what you're doing?
$ clang-tot --save-temps -Weverything -c tmp.c
tmp.c:2:99: warning: equality comparison with extraneous parentheses [-
Wparentheses-equality]
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
tmp.c:2:99: note: remove extraneous parentheses around the comparison to
silence this warning
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
~ ^ ~
tmp.c:2:99: note: use '=' to turn this equality comparison into an assignment
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
^~
=
tmp.c:2:6: warning: no previous prototype for function 'f' [-Wmissing-
prototypes]
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
^
2 warnings generated.
I believe --save-temps is only intended as a debugging aid & doesn't guarantee
diagnostic consistency with the usual compile command line? But I'm not
entirely sure. Perhaps we don't have an official stance on this...