🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1003

Apparent g++ problem

#1003
From: John Juer
Date: Thu, 01 Oct 1992 14:04
34 lines
1296 bytes
gcc version 2.2.2, on Interactive version 3.0

It seems that when compiling without the optimiser and with debug on
in-line functions do not get in-lined, resulting in undefined symbols
on the final link.

(jay)$ g++ -c -O -I../include -Di386ix prctxt.C
(jay)$ nm prctxt.o | fgrep _12symbol_stacki
the final link worked fine

(jay)$ g++ -c -g -I../include -Di386ix prctxt.C
(jay)$ nm prctxt.o | fgrep _12symbol_stacki
__12symbol_stacki   |       0|extern|                  |      |     |

__12symbol_stacki was undefined on the final link.

This was an in-line function, here is an extract from the header file.

#pragma interface
class symbol_stack
{
.....
public:
  symbol_stack(int sz = 20 ) 
  {
    top = s = new symbol*[size = sz];
  }
.....
};



Since you can run with -O and -g its not really a problem once you
know what is going on!
Technical Details
Message-ID: <15557.9210011204@pine.eurotherm.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!etherm.co.UK!jj00

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!etherm.co.UK!jj00
From: jj00@etherm.co.UK (John Juer)
Subject: Apparent g++ problem
Message-ID: <15557.9210011204@pine.eurotherm.co.uk>
Sender: gnulists@ai.mit.edu
Organization: Eurotherm Controls Limited.
Distribution: gnu
Date: Thu, 1 Oct 1992 14:04:24 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 36