Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.utils.bug > #2276 > unrolled thread

ld resolving different types

Started byNorman Goldstein <normvcr@telus.net>
First post2020-02-15 16:51 -0800
Last post2020-02-15 16:51 -0800
Articles 1 — 1 participant

Back to article view | Back to gnu.utils.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  ld resolving different types Norman Goldstein <normvcr@telus.net> - 2020-02-15 16:51 -0800

#2276 — ld resolving different types

FromNorman Goldstein <normvcr@telus.net>
Date2020-02-15 16:51 -0800
Subjectld resolving different types
Message-ID<mailman.946.1581814281.2412.bug-gnu-utils@gnu.org>

[Multipart message — attachments visible in raw view] — view raw

LD version:
    GNU ld version 2.31.1-37.fc30

Platform:
    Linux 5.4.17-100.fc30.x86_64 #1 SMP     x86_64 x86_64 x86_64 GNU/Linux

Compile/Link command:
     gcc tlink.cpp tlink2.cpp -o tlink -lstdc++

The programs compiles and links without warning or error, but resolves 
/extern int foo/ with /double foo/.  The result of running the program 
is, of course, garbage:

foo= -858993459

The program contains only 1 definition for foo (the extern statement is 
a declaration), so the program is not violating the One Definition Rule.

Thank you.



[toc] | [standalone]


Back to top | Article view | gnu.utils.bug


csiph-web