http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52779
Bug #: 52779 Summary: [4.6 only] LTO produces false warning with type merging Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: pins...@gcc.gnu.org Take the following three files: --- t0.c ---- void g1 (void) { __builtin_printf("+++\n"); } --- CUT --- --- t1.c --- const char glbl_str4[] = "New"; --- CUT --- --- t2.c --- extern const char glbl_str4[]; void g0 (void) { f0(glbl_str4); } --- CUT --- Using "gcc -flto -O3 -r -nostdlib t0.c t1.c t2.c" produces the following warning: t2.c:1:19: warning: type of ‘glbl_str4’ does not match original declaration [enabled by default] t1.c:1:13: note: previously declared here ---- CUT ---- Note the order of the files is required so is the semi unrelated t0.c file.