🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ron Guilmette Sat, 11 Mar 1989 00:58
BUG(s) in G++ 1.34.0 - bogus warnings
#1723
Author: Ron Guilmette
Date: Sat, 11 Mar 1989 00:58
44 lines
2279 bytes
The following code causes G++ 1.34.0 to correctly issue an error
(actually two errors) for the ambigous declaration(s).  Unfortunately,
it then also issues two bogus warnings.  The compiler messages follow
the code below:

Cut here
----------------------------------------------------------------------
/*
Description - check that if two overloaded functions are declared within the
		same scope, and if these two functions are essentially
		identical in their names and in their number, order,
		and type of parameters except that one of the two has
		more parameters than the other, but these additional
		parameters all have defaults, an appropriate error is
		issued for the (ambiguous) declaration(s).
*/

overload function1;

void function1 (int arg1, int arg2);
void function1 (int arg1, int arg2, int arg3 = 88);

main ()
{
	function1 (3,4);
}
------------------------------------------------------------------------
g++  -S -v x02.cc
g++ version 1.34.0.0
 /usr/local/src/lib/1.34.0.0/sun3/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 x02.cc /tmp/cca08777.cpp
GNU CPP version 1.34.0.0
 /usr/local/src/lib/1.34.0.0/sun3/gcc-c++ /tmp/cca08777.cpp -quiet -dumpbase x02.cc -noreg -version -o x02.s
GNU C++ version 1.34.0.0 (68k, MIT syntax) compiled by GNU C version 1.33.
x02.cc:14: conflicting types for `void function1 (int, int, int (=  88 ))'
x02.cc:13: previous declaration of `void function1 (int, int)'
x02.cc:14: warning: `function1_SI_SI' was declared `extern' and later `static'
x02.cc:13: warning: previous declaration of `function1_SI_SI'


// Ron Guilmette  -  MCC  -  Experimental (parallel) Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg
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