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/60838] bugos warning: initializer element is not a constant expression: int test = (0 ? (1,0) : 0) + 1;


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

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