public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/7853: gcc reports multiple symbol definitions on the wrong line
@ 2002-09-08  0:06 Matthias Klose
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Klose @ 2002-09-08  0:06 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc; +Cc: chris


>Number:         7853
>Category:       c
>Synopsis:       gcc reports multiple symbol definitions on the wrong line
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 08 00:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Suffield <aps100@doc.ic.ac.uk>
>Release:        3.2.1 CVS (Debian) (Debian unstable)
>Organization:
The Debian Project
>Environment:
System: Debian GNU/Linux (unstable)
Architecture: i686
	
>Description:
[ Reported to the Debian BTS as report #159838.
  Please CC 159838@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/159838 ]

Andrew Suffield writes:

(I am not sure whether this is a bug in gcc or binutils)

aps100@cyclone:~/tmp$ cat foo.c
int x = 0;

aps100@cyclone:~/tmp$ cat bar.c
int x = 0;

void foo(void) {}

aps100@cyclone:~/tmp$ gcc -shared -g -o foo.so foo.c bar.c
/tmp/cc0wTF8S.o: In function `foo':
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/aps100/tmp/bar.c:3: multiple definition of `x'
                       ^
/tmp/ccpK9pwb.o(.data+0x0):/home/aps100/tmp/foo.c: first defined here
collect2: ld returned 1 exit status
aps100@cyclone:~/tmp$ gcc-3.2 -shared -g -o foo.so foo.c bar.c
/tmp/ccBwlA8f.o: In function `foo':
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/aps100/tmp/bar.c:3: multiple definition of `x'
                       ^
/tmp/cckwx9Kb.o(.data+0x0): first defined here
collect2: ld returned 1 exit status

Note the indicated parts. Function 'foo' has got nothing to do with
the problem, and that's the wrong place to be highlighting the error.

More generally, it appears that symbol conflicts in the global scope
will always be reported as being in the first function in the
compilation unit (not thoroughly tested, but that's what I
noticed). This means the error message might not even be pointing at
the correct file, let alone the right line.

(Needless to say, this is quite irritating).



	
>How-To-Repeat:
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/7853: gcc reports multiple symbol definitions on the wrong line
@ 2002-10-09 18:25 ljrittle
  0 siblings, 0 replies; 3+ messages in thread
From: ljrittle @ 2002-10-09 18:25 UTC (permalink / raw)
  To: 159838, aps100, gcc-bugs, gcc-prs, nobody

Synopsis: gcc reports multiple symbol definitions on the wrong line

State-Changed-From-To: closed->open
State-Changed-By: ljrittle
State-Changed-When: Wed Oct  9 18:25:47 2002
State-Changed-Why:
    Undo, not fixed yet.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7853


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/7853: gcc reports multiple symbol definitions on the wrong line
@ 2002-10-09 15:31 ljrittle
  0 siblings, 0 replies; 3+ messages in thread
From: ljrittle @ 2002-10-09 15:31 UTC (permalink / raw)
  To: 159838, aps100, gcc-bugs, gcc-prs, nobody

Synopsis: gcc reports multiple symbol definitions on the wrong line

State-Changed-From-To: open->closed
State-Changed-By: ljrittle
State-Changed-When: Wed Oct  9 15:31:26 2002
State-Changed-Why:
    Fixed on mainline according to Peter Schmid.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7853


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-10  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-08  0:06 c/7853: gcc reports multiple symbol definitions on the wrong line Matthias Klose
2002-10-09 15:31 ljrittle
2002-10-09 18:25 ljrittle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).