[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-09-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-09-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 --- Comment #8 from Marek Polacek --- Author: mpolacek Date: Fri Sep 4 12:37:39 2015 New Revision: 227491 URL: https://gcc.gnu.org/viewcvs?rev=227491=gcc=rev Log: PR sanitizer/67279 * c-typeck.c (build_binary_op): Don't

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-09-02 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-20 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 --- Comment #6 from Vittorio Zecca zeccav at gmail dot com --- On my side it has to do with the C standard. Compilation with -ansi or -std=c90 is successful. Compilation with -std=c99 fails. Compiling with g++ is OK. The behaviour I would like

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-20 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 --- Comment #7 from Marek Polacek mpolacek at gcc dot gnu.org --- Yeah, I think I'll change this.

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added CC||mpolacek at

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-19 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 --- Comment #2 from Vittorio Zecca zeccav at gmail dot com --- UB = undefined behaviour? Why then it is only signaled if static attribute is requested? This is accepted:int dec_1 = 1 31; Isn't UB as well if it is not static? I believe gcc should

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-19 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 --- Comment #3 from Vittorio Zecca zeccav at gmail dot com --- The following code has UB at lines 4 and 5 but compiles with -fsanitize=undefined int main() { int test[1],t; t=test[1]; return test[1]; } Its execution it delivers four runtime

[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

2015-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67279 --- Comment #5 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Manuel López-Ibáñez from comment #4) A possible solution could be to give a warning enabled by default (about 1 31 being undefined) and to NOT sanitize