🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Drazen Borkovic Wed, 09 Aug 1989 22:27
(none)
#339
Author: Drazen Borkovic
Date: Wed, 09 Aug 1989 22:27
34 lines
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
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