Thread View: gnu.g++.bug
2 messages
2 total messages
Started by zhao
Tue, 08 Nov 1988 01:51
Type Check Bug in G++ 1.27.0
Author: zhao
Date: Tue, 08 Nov 1988 01:51
Date: Tue, 08 Nov 1988 01:51
39 lines
1369 bytes
1369 bytes
I believe the following example demonstrates a bug in the type checking of
g++ 1.27.0.
Machine: SUN3/60M OS: 3.4
[1]: cat bug.cc
// File bug.cc
class foo {
private:
int s1, s2;
public:
foo () { s1 = 0; s2 = 0; }
void set1 (int l);
void set2 (int l);
};
void foo::set1 (int l) { s1 = l; }
void foo::set2 (int l) { s2 = l; }
foo BAR;
void test ()
{
BAR.set1 (1);
set2 (2); // <<---- Compiler should issue warning here.
}
[2]: g++ -c -v bug.cc
g++ version 1.27.0
/usr/local/lib/gcc-cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix bug.cc /tmp/cca16246.cpp
GNU CPP version 1.27.0
/usr/local/lib/gcc-c++ /tmp/cca16246.cpp -quiet -dumpbase bug.cc -noreg -version -o /tmp/cca16246.s
GNU C++ version 1.27.0 (68k, MIT syntax) compiled by GNU C version 1.27.
as -mc68020 /tmp/cca16246.s -o bug.o
[3]: exit
No warning message is issued even though an obvious syntax error is presented.
Re: Type Check Bug in G++ 1.27.0
Author: zhao
Date: Tue, 08 Nov 1988 02:08
Date: Tue, 08 Nov 1988 02:08
3 lines
646 bytes
646 bytes
I apologize for the mistake in my previous post. After examming the assembly codes, I realized that it really shouldn't be called a serious bug though a warning message might be better.
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