This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/52779] New: [4.6 only] LTO produces false warning with type merging
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Mar 2012 18:29:45 +0000
- Subject: [Bug lto/52779] New: [4.6 only] LTO produces false warning with type merging
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: pinskia@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.