[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 changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment

[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 --- 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 deliver a warning

[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 --- 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 errors from the sanitizer an

[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 changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[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 --- (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 expressions that are required

[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 --- 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 to see is a warning at co

[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 --- Yeah, I think I'll change this.

[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 a

[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&root=gcc&view=rev Log: PR sanitizer/67279 * c-typeck.c (build_binary_op): Don'

[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|---