[Bug c/80868] "Duplicate const" warning emitted in `const typeof(foo) bar;`

ndesaulniers at google dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 24 21:04:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80868

--- Comment #5 from Nick Desaulniers <ndesaulniers at google dot com> ---
Oh, note in the typedef case:

typedef const int t;
const t x;

It seems that for -std=c89 (non pedantic, non GNU), GCC does not warn.  That
seems to violate C90 6.5.3 constraints: "The same type qualifier shall not
appear more than once in the same specifier-list or qualifier-list, either
directly or via one or more typedefs."


More information about the Gcc-bugs mailing list