This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/24016] Missing warning for unspecified evaluation order


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"); });
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]