$ cat x.cpp char const c1[] = { '\0' }; static char const* cp1 = c1; int main() { return 0; }
$ g++ -Wall -gdwarf-2 -g2 x.cpp -o x x.cpp:2: warning: ‘cp1’ defined but not used /tmp/ccyTiLjt.o:(.debug_info+0xe2): undefined reference to `c1' collect2: ld returned 1 exit status gcc version 4.2.0 20061225 -- Summary: [link-failure] .debug_info causes undefined reference. Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at agmk dot net GCC target triplet: x86_64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30305