🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Bryan Boreham Tue, 13 Jun 1989 19:19
g++ 1.35.1- dumps core on erroneous "pointer-to-member" usage.
#56
Author: Bryan Boreham
Date: Tue, 13 Jun 1989 19:19
42 lines
1659 bytes
The example:

extern "C" char* strcpy(char*, char*);

class Object;

typedef void* (Object::*PROC)(...);

class Object
{
 public:
  void getValue(PROC ptr, char* retValue)
    {
      strcpy(retValue, this->(*ptr));
    }
};

kewill% g++ -c -v bug3.cc
g++ version 1.35.1-
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc6800
0 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug
3.cc /tmp/cca02102.cpp
GNU CPP version 1.35
 /usr/local/lib/gcc-cc1plus /tmp/cca02102.cpp -quiet -dumpbase bug3.cc -noreg -v
ersion -o /tmp/cca02102.s
GNU C++ version 1.35.1- (68k, MIT syntax) compiled by GNU C version 1.35.
bug3.cc:5: warning: lazy prototyping frowned upon
g++: Program cc1plus got fatal signal 6.

I know the code is wrong. As an aside, is there a way to make g++ shut
up about the lazy prototyping in places where I really do need it?

Or maybe I don't really need it, and someone can tell me more.


Bryan Boreham           {The Atlantic} ... mcvax!ukc!root44!kewill!bryan
Software Engineer
Kewill Systems PLC      Work: (+44) 932 248 328
Walton-On-Thames
Surrey KT12 2QS
England                 PS: I got the ET++ collections to work!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads