This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61012] New: lto1: errors during merging of translation units (error: variable âlinkâ redeclared as function)
- From: "mliska at suse dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Apr 2014 11:19:16 +0000
- Subject: [Bug c++/61012] New: lto1: errors during merging of translation units (error: variable âlinkâ redeclared as function)
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61012
Bug ID: 61012
Summary: lto1: errors during merging of translation units
(error: variable âlinkâ redeclared as function)
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mliska at suse dot cz
$ cat a.c
struct s
{
int a;
int b;
};
static struct s link = { 1, 2 };
int foo()
{
return link.a;
}
$ cat b.c
#include <unistd.h>
int main()
{
int r = link("aaa", "bbb");
return foo();
}
$ gcc a.c b.c -flto -O2
/usr/include/unistd.h:812:12: error: variable âlinkâ redeclared as function
extern int link (const char *__from, const char *__to)
^
a.c:7:17: note: previously declared here
static struct s link = { 1, 2 };
^
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: gcc returned 1 exit status
/home/marxin/Programming/bin/gcc2/lib64/gcc/x86_64-unknown-linux-gnu/4.10.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status