🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: pragma interface blocks inlining new-with-placement

#249
From: Mike Stump
Date: Mon, 13 Apr 1992 21:53
69 lines
2917 bytes
I hate to give you the run around, but it IS a problem with libg++.
It sounds like there is a #pragma interface in new.h but there is no
corresponding #pragma implementation of that file.

Feel free to submit it again, over there in 
	bug-lib-g++@prep.ai.mit.edu

> Date: Sun, 12 Apr 92 01:17:12 CDT
> From: dougm@cs.rice.edu (Doug Moore)
> Sender: gnulists@ai.mit.edu
> Message-Id: <9204120617.AA07200@cs.rice.edu>
> To: bug-g++@prep.ai.mit.edu
> Subject: pragma interface blocks inlining new-with-placement

> The following program

> -------cut here---------
> #include <new.h>

> class foo
> {
> public:
>   int baz;
>   foo(int b): baz(b) {}
> };

> main()
> {
>   foo* foop = (foo*) malloc(sizeof(foo));
>   foop = new {foop} foo(4);
> }
> -------cut here---------

> where new.h comes from libg++-2.0,
> does not link successfully.

> -------cut here---------
> cd /marsh/comp212/.jnkk/
> c++ -g -Wall -v bug.cc
> Reading specs from /marsh/comp212/lib/gcc-lib/sun4/2.1/specs
> gcc version 2.1
>  /marsh/comp212/lib/gcc-lib/sun4/2.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -g -Wall bug.cc /usr/tmp/cca14672.i
> GNU CPP version 2.1 (sparc)
>  /marsh/comp212/lib/gcc-lib/sun4/2.1/cc1plus /usr/tmp/cca14672.i -quiet -dumpbase bug.cc -g -Wall -version -o /usr/tmp/cca14672.s
> GNU C++ version 2.1 (sparc) compiled by GNU C version 2.1.
>  as -o bug.o /usr/tmp/cca14672.s
>  /marsh/comp212/lib/gcc-lib/sun4/2.1/ld -e start -dc -dp /lib/crt0.o -L/marsh/comp212/lib/gcc-lib/sun4/2.1/ -L/marsh/comp212/lib/ bug.o -lg++ -lm -lgcc -lc -lg -lgcc
> ld: Undefined symbol 
>    ___nw__FiPv 
> collect: /usr/bin/ld returned 2 exit status

> Compilation exited abnormally with code 1 at Sun Apr 12 01:05:36
> -------cut here---------

> However, when I comment out the #pragma interface line of new.h, it
> does link successfully.  The file new.h includes an inline static
> definition of the function that is claimed to be undefined.

> I am not making the same complaint as the gentleman who complained
> that nm showed a particular symbol to be undefined.  I am complaining
> that inlining does not happen in the presence of #pragma interface, at
> least for operator new with placement syntax.

> That is why I'm sending this to g++.bug, not to libg++.bug.

> Sparc 2.  Sunos 4.1.  Gcc 2.1, with Tiemann and Stump patches.

> Doug Moore
> (dougm@cs.rice.edu)
Technical Details
Message-ID: <9204132153.AA02674@cygnus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs
From: mrs@cygnus.com (Mike Stump)
Subject: Re:  pragma interface blocks inlining new-with-placement
Message-ID: <9204132153.AA02674@cygnus.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 13 Apr 1992 21:53:57 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 73