http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59331
Bug ID: 59331 Summary: ubsan gives extra warnings with vla. Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: larsbj at gullik dot net CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org g++ (GCC) 4.9.0 20131128 (experimental) Copyright (C) 2013 Free Software Foundation, Inc. r205479 This snippet: --------- void foo(int i) { char a[i]; (void)a; } --------- Compiled with: g++ -c -std=gnu++11 -Wall -fsanitize=undefined gives this warning: In function ‘void foo(int)’: 3:13: warning: value computed is not used [-Wunused-value] If -fsanitize=undefined is removed, no warning is given.