egcs_1_1_branch 10-30-98 bug

Jason Merrill jason@cygnus.com
Tue Nov 3 00:51:00 GMT 1998


>>>>> Jack Howarth <howarth@nitro.med.uc.edu> writes:

 >    The egcs_1_1_branch cvs changes as of 10/30/98 seem to be causing
 > a new problem when building kshisen in kdegames of kde 1.0. It fails
 > on link for no apparent reason now. The same cvs of a couple days back
 > had no such problem.

Thanks for the heads-up.

 > app.o(.text+0x2a98): undefined reference to `Board::x_tiles(void)'

The KDE code is wrong; they define x_tiles inline, but only in board.cpp.
Since all uses of x_tiles can be inlined, g++ doesn't emit an out-of-line
copy.  The standard sez:

  7.1.2 - Function specifiers [dcl.fct.spec]

  -4- An inline function shall be defined in every translation unit in which
  it is used and shall have exactly the same definition in every case
  (basic.def.odr). [Note: a call to the inline function may be encountered
  before its definition appears in the translation unit. ] If a function with
  external linkage is declared inline in one translation unit, it shall be
  declared inline in all translation units in which it appears; no diagnostic
  is required.

There is also a g++ bug here, but it's a bug in a heuristic that KDE should
not be relying on.

Jason



More information about the Gcc-bugs mailing list