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


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

bug: gnu linker resolves two symbols but of different type

Started byNorman Goldstein <normvcr@telus.net>
First post2020-02-05 00:05 -0800
Last post2020-02-05 00:05 -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

  bug: gnu linker resolves two symbols but of different type Norman Goldstein <normvcr@telus.net> - 2020-02-05 00:05 -0800

#2275 — bug: gnu linker resolves two symbols but of different type

FromNorman Goldstein <normvcr@telus.net>
Date2020-02-05 00:05 -0800
Subjectbug: gnu linker resolves two symbols but of different type
Message-ID<mailman.330.1580909581.2412.bug-gnu-utils@gnu.org>
Runnig on fedora 30, x86-64.
Here are two source files which compile and link without error, but 
which break type expectations and not what the programmer would want.  
The type of "foo" is different in the two files:

a.cpp:
//////
double foo = 2.1;

b.cpp
//////
#include <iostream>
using namespace std;

extern int foo;

int main( int argc, char* argv[] )
{
   cout << "foo= " << foo << endl;

   return 0;
}

////////////
On Windows 10, the visual studio cl.exe complains at link time.

[toc] | [standalone]


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


csiph-web