Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug: gnu linker resolves two symbols but of different type

0 views
Skip to first unread message

Norman Goldstein

unread,
Feb 5, 2020, 8:33:02 AM2/5/20
to bug-gn...@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.

0 new messages