linker bug or feature request

H.J. Lu
Wed Feb 3 17:20:00 GMT 1999

> Greetings,
> The very simple code included is broken.  It omits the 'inline' keyword on an
> inline function definition in a header file.  Because of this oversight, it
> has the same external symbol in more than one translation unit.  This is
> clearly a bug in the included code.  What is interesting about this bug is
> what the linker does (and does not do).  If I try to link non-shared objects,
> I get a link error.  If I try to link shared objects, I do NOT get a link error.
> The linker fails silently.  As you can see by the example, the compiler
> does not call the static initializers correctly.
> Could a feature be added to the linker to test for and fail linking when this
> kind of situation occurs?

BTW, it will be in egcs for Linux.


More information about the Gcc-patches mailing list