This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60838] bugos warning: initializer element is not a constant expression: int test = (0 ? (1,0) : 0) + 1;
- From: "potrepalov at asc-ural dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Apr 2014 06:41:24 +0000
- Subject: [Bug c/60838] bugos warning: initializer element is not a constant expression: int test = (0 ? (1,0) : 0) + 1;
- Auto-submitted: auto-generated
- References: <bug-60838-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60838
--- Comment #1 from ilya <potrepalov@asc-ural.ru> ---
Another testcase:
main.c
-----------------
int test1 = (0 ? 0 : 0) + 1;
int test2 = (0 ? (3, 0) : 0) + 1;
int test3[(0 ? 0 : 0) + 1];
int test4[(0 ? (3, 0) : 0) + 1];
int main( void ) { return 0; }
-----------------
>gcc main.c
main.c:2:13: warning: initializer element is not a constant expression
main.c:4:5: error: variably modified âtest4â at file scope
Checked for:
gcc version 4.5.3 (GCC)
gcc version 4.7.3