This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug lto/52779] New: [4.6 only] LTO produces false warning with type merging


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]