🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

#pragma interface -- whose bug is it anyway?

#109
From: Mark Purtill
Date: Mon, 06 Apr 1992 22:37
36 lines
1521 bytes
On a Sparcstation 2 (which is not connected to the outside;  I'm
typing this in from a printed transcript, so I might err).
% gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.1/specs
gcc version 2.1
% more /etc/motd
SunOS Release 4.1.1 (CARS_2) #3: Thu Aug 15 10:35:49 EDT 1991
% cat >A.h
#pragma interface
struct A {
    A() ;
    };
inline A::A() {}
^D
% cat > B.C
#include "A.h"

struct B {
    A* _copy(A* t);
    };

A* B::_copy(A* t) {
    A* x = new A();
  return 0 ;
    }
^D
% gcc -c B.C	
	And now if you examine B.o with nm, you should find A::A() as
an undefined global.  Removing the "#pragma interface" causes the
problem to go away.
	Now, "#pragma interface" does not seem to be documented, so
maybe this is correct behaviour for gcc.  If so, then this is a libg++
bug, which occurs in (at least) int SplayBag s.

^.-.^ Mark Purtill, IDA/CCR-P, Thanet Road, Princeton NJ  08540; (609)924-4600.
((")) Email: purtill%idacrd@princeton.edu; uunet!idacrd!purtill. (609)497-0526.
Technical Details
Message-ID: <9204062237.AA05389@>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!ai.mit.edu!gnulists

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!ai.mit.edu!gnulists
From: purtill%idacrd@uunet.uu.net (Mark Purtill)
Newsgroups: gnu.g++.bug,gnu.g++.lib.bug
Subject: #pragma interface -- whose bug is it anyway?
Message-ID: <9204062237.AA05389@>
Date: 6 Apr 92 22:37:48 GMT
Article-I.D.: .9204062237.AA05389
Followup-To: gnu.g++.bug,gnu.g++.lib.bug
Lines: 36
Approved: info-gnu@prep.ai.mit.edu
To: bug-gcc@prep.ai.mit.edu, bug-lib-g++@prep.ai.mit.edu