You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When run with -w, GCC disables all warnings, including those which have been explicitly promoted to errors with -Werror=warningname. Clang’s -w disables all warnings except those which have been so promoted. For example:
$ cat <<EOF >c.c
> void f() {
> int x;
> if (x = 1) {}
> }
> EOF
$ gcc -Werror=parentheses -w -c -o /dev/null c.c
$ clang -Werror=parentheses -w -c -o /dev/null c.c
c.c:3:9: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
if (x = 1) {}
~~^~~
c.c:3:9: note: place parentheses around the assignment to silence this warning
if (x = 1) {}
^
( )
c.c:3:9: note: use '==' to turn this assignment into an equality comparison
if (x = 1) {}
^
==
1 error generated.
Extended Description
When run with -w, GCC disables all warnings, including those which have been explicitly promoted to errors with -Werror=warningname. Clang’s -w disables all warnings except those which have been so promoted. For example:
This is already a FIXME in DiagnosticIDs.cpp (https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?revision=331834&view=markup#l460).
The text was updated successfully, but these errors were encountered: