Article View: gnu.g++.bug
Article #1525Type Check Bug in G++ 1.27.0
From: 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.
Technical Details
Message-ID:
<13304@oberon.USC.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!oberon!wiener.usc.edu!zhaoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!oberon!wiener.usc.edu!zhao From: zhao@wiener.usc.edu Newsgroups: gnu.g++.bug Subject: Type Check Bug in G++ 1.27.0 Message-ID: <13304@oberon.USC.EDU> Date: 8 Nov 88 01:51:57 GMT Sender: news@oberon.USC.EDU Reply-To: zhao@wiener.usc.edu Distribution: gnu Organization: University of Southern California Lines: 38