This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24016] Missing warning for unspecified evaluation order
- From: "miyuki at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 23 May 2015 06:09:08 +0000
- Subject: [Bug c/24016] Missing warning for unspecified evaluation order
- Auto-submitted: auto-generated
- References: <bug-24016-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24016
Mikhail Maltsev <miyuki at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |miyuki at gcc dot gnu.org
--- Comment #3 from Mikhail Maltsev <miyuki at gcc dot gnu.org> ---
It seems to me that __extension__ also inhibits some other useful warnings. For
example:
#include <string.h>
int foo(void *x) {
return strcmp(x + 1, "test");
}
does not cause warnings when compiled with -Wpointer-arith -O1 (glibc v. 2.17).
It can be reduced to:
int foo(void *x) {
return __extension__({ __builtin_strcmp(x + 1, "test"); });
}
Note, that we do warn about
int foo(void *x) {
return ({ __builtin_strcmp(x + 1, "test"); });
}