Article View: gnu.g++.bug
Article #339(none)
From: Drazen Borkovic
Date: Wed, 09 Aug 1989 22:27
Date: Wed, 09 Aug 1989 22:27
34 lines
1460 bytes
1460 bytes
This concerns a warning that g++ produces about friend functions:
==================================================================
$ cat i.cc
class a { // in real life from `#include "a.h"'
public:
friend int fun( a x, a y);
};
int f()
{
a x,y;
int i = fun(x,y);
return i;
}
$ g++ -v -W -Wall -S i.cc
g++ version 1.35.1-
/usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Wall -D__HAVE_68881__ -Dmc68020 i.cc /tmp/cca15154.cpp
GNU CPP version 1.35
/usr/local/lib/gcc-cc1plus /tmp/cca15154.cpp -quiet -dumpbase i.cc -W -Wall -noreg -version -o i.s
GNU C++ version 1.35.1- (68k, MIT syntax) compiled by GNU C version 1.35.0+.
i.cc:3: warning: `int fun (struct a, struct a)' declared but never defined
$
==================================================================
Considering that class definitions are usually in the separate ".h" file,
the warning that g++ produces seems unnecessary.
Drazen Borkovic
CS dept, Caltech 256-80, Pasadena CA 91125
drazen@vlsi.caltech.edu
Technical Details
Message-ID:
<8908092227.AA28767@vlsi.caltech.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!VLSI.CALTECH.EDU!drazenShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!VLSI.CALTECH.EDU!drazen From: drazen@VLSI.CALTECH.EDU (Drazen Borkovic) Newsgroups: gnu.g++.bug Subject: (none) Message-ID: <8908092227.AA28767@vlsi.caltech.edu> Date: 9 Aug 89 22:27:40 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 34