https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24786
dank at kegel dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from dank at kegel dot com --- Methinks it's been fixed: $ gcc --version gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0 $ gcc -c blah.c blah.c: In function ‘blah1’: blah.c:3:11: warning: function returns address of local variable [-Wreturn-local-addr] 3 | return &x; | ^~ blah.c: In function ‘blah2’: blah.c:8:36: error: initializer element is not constant 8 | static const char *names[1] = { &x }; | ^ blah.c:8:36: note: (near initialization for ‘names[0]’) Also fixed with: gcc-6 (Ubuntu 6.5.0-2ubuntu1) 6.5.0 20181026 Marking fixed. But see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69433