egcs bug?
Bryan Weston
bryanw@bluemoon.sps.mot.com
Fri Oct 2 06:41:00 GMT 1998
System: SunOS bluemoon 5.6 Generic_105181-04 sun4u sparc SUNW,Ultra-1
Compiler: gcc version egcs-2.92.11 19980921 (gcc2 ss-980609 experimental)
Options: -g -Wall -W -ansi -pedantic
-Wtraditional -Wcast-qual -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Winline
I have some code that is running fine an GCC 2.7.2 and 2.8.1 that is
failing on egcs. I tried egcs release 1.1 and the September 21 snapshot.
It also works on the Sun CC compiler.
I have enclosed an example program with a Makefile, a source file
(test.cc) and three Solaris 2.6 executable. One compile with 2.7.2, one
with 2.8.1 and one with egcs.
I have also seen this problem on Linux. The test is a simple program that
demonstates the problem.
The "Test" class has an array of pointers to the "SensorBase" class. The
"Test" constructor creates a class of type "Sensor<Test>" and add it the
pointer to it's list of pointers. This is done like:
datasensor[count++] = new Sensor<Test> ();
The new sensor is created and added to the list OK, but count is not being
incremented.
The expected output is:
%Success: test.cc: 84: ./test2.8.1 worked
The following is the output I got with the different compilers:
./testCC
%Success: test.cc: 84: ./testCC worked
./test2.7.2
%Success: test.cc: 84: ./test2.7.2 worked
./test2.8.1
%Success: test.cc: 84: ./test2.8.1 worked
./test2.92.11
!ERROR: test.cc: 54: count!=1, count = 0
!ERROR: test.cc: 60: count!=2, count = 1
!ERROR: test.cc: 87: ./test2.92.11 had errors
gnumake: *** [run] Error 2
I would appreciate if you let me know when a path is available.
If you have any questions, call me (512)895-3483 or email me.
--
Bryan Weston
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar.gz
Type: application/x-gzip
Size: 94121 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19981002/d5a2c76a/attachment.bin>
More information about the Gcc-bugs
mailing list