[Bug c/106535] New: GCC doesn't reject non-constant initializer if -pedantic is specified but does so in any other circumstances
gabravier at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Aug 5 09:57:15 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106535
Bug ID: 106535
Summary: GCC doesn't reject non-constant initializer if
-pedantic is specified but does so in any other
circumstances
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: gabravier at gmail dot com
Target Milestone: ---
int f = (0, 0);
Compiled without any options:
<source>:1:9: error: initializer element is not constant
1 | int f = (0, 0);
| ^
Compiled with -pedantic:
<source>:1:9: warning: initializer element is not constant [-Wpedantic]
1 | int f = (0, 0);
| ^
It seems rather odd that adding -pedantic transforms an error into a warning...
More information about the Gcc-bugs
mailing list