Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!alicudi.usc.edu!crum From: crum@alicudi.usc.edu (Gary L. Crum) Newsgroups: gnu.g++ Subject: bug? - compiles using 1.35.0+ but not 1.36.1 Message-ID: Date: 5 Dec 89 03:52:46 GMT Sender: news@usc.edu Distribution: gnu Organization: University of Southern California Lines: 285 For the case where USENET folks out there want to take a whack at it, I am posting a bug report that I sent to bug-g++ earlier today. Here it is: Return-Path: Date: Mon, 4 Dec 89 17:18:36 PST From: crum@alicudi.usc.edu (Gary L. Crum) To: bug-g++@prep.ai.mit.edu Cc: masotti@alicudi.usc.edu, action@alicudi.usc.edu Subject: bug? - compiles using 1.35.0+ but not 1.36.1 I have include a program that compiles using g++ 1.35.0+ (on panarea.usc.edu, a Sun-3/50 running SunOS 4.0.3) but not using g++ 1.36.1 (on alicudi.usc.edu, a Sun-4/60 running SunOS 4.0.3c). I am not completely sure that my the problem indicates a bug in the new g++, because I am not the person that works with g++ source code here. USC University Computing Services (perhaps tli and/or mcooper at usc.edu) maintains GNU software centrally for many Sun UNIX systems to NFS-mount. The problem is related to using C function declarations in C++ using extern "C". It is not related to using the istream class in libg++. To see the problem, you may follow these instructions: 1. Save this message as "msg" on a UNIX system. 2. Do "uudecode < msg; tar xpvof crumbug.tar; cd crumbug". 3. Do "make". A compiler error message occurs when I attempt this with g++ 1.36.1, but not with g++ 1.35.0. The uuencoded tar file used in above procedure is included at the end of this message. Here is a script of my attempt to compile "bug.cc" with 1.36.1, but it is not necessary for you to look at this script if you don't want to. My uucoded tar file attachment was meant to save you time by eliminating the need for extracting code from this message. --- alicudi:~/pal/g++_notes/crumbug g++ -version gcc version 1.36.1 (based on GCC 1.36) alicudi:~/pal/g++_notes/crumbug make g++ -g -c bug.cc bug.cc: In function void catch_signals (): bug.cc:9: argument passing between incompatible pointer types bug.cc:10: argument passing between incompatible pointer types bug.cc:11: argument passing between incompatible pointer types *** Error code 1 make: Fatal error: Command failed for target `bug.o' alicudi:~/pal/g++_notes/crumbug --- bug, when I compile "bug.cc" with 1.35.0+: --- panarea:~/pal/g++_notes/crumbug g++ -version g++ version 1.35.0+ panarea:~/pal/g++_notes/crumbug make g++ -g -c bug.cc panarea:~/pal/g++_notes/crumbug --- The above (compile using g++ 1.35.0+) produces bug.o. Here is bug.cc: --- extern "C" { #include } extern int badNews(int code=0, char* context=""); void catch_signals() { signal(SIGFPE, badNews); signal(SIGBUS, badNews); signal(SIGSEGV, badNews); } --- The declaration of the function signal() in /usr/include/signal.h is: --- void (*signal())(); --- The signal.h include files on both systems are identical. My workaround is to use my own declaration for signal(), in the C++ style, instead of using the system signal.h file. The declaration I use is: --- #define SIGFPE 8 /* floating point exception */ #define SIGBUS 10 /* bus error */ #define SIGSEGV 11 /* segmentation violation */ extern void (*signal(int, void*))(); --- This is the end of my bug report. If you cannot address my report immediately, then please acknowledge receipt of this message to avoid a retransmission. I would appreciate such an acknowledgement. Gary begin 664 crumbug.tar M8W)U;6)U9R\ M M " @(#'1E'1E