🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ed Oskiewicz Wed, 04 Nov 1992 15:33
gcc2.31/sun4/sunos4.1 *MINOR* -Wredundant-decls give spurious warnings
#76
Author: Ed Oskiewicz
Date: Wed, 04 Nov 1992 15:33
37 lines
1391 bytes
Synopsis:

Declaring an extern function in traditional form followed by a declaration
with prototype causes warnings from -Wredundant-decls. The following minimal
program exercises the diagnostic (in practice the declarations are in separate
header files):

/* Compile by gcc -ansi -Wall -Wredundant-decls test.c */
#include <stdio.h>

int foo();

int foo(int a, int b);

void main()
{
}

foo(int a, int b)
{
  return a+b;
}

/* End of example */

I don't know whether this is strictly a bug or not but the effects are
annoying. Surely in this case the redeclaration has an effect insofar as
prototype information is being supplied and so warnings should not result.

Cheers,

Ed Oskiewicz

email:	eo@ansa.co.uk (mcsun!uknet!ansa!eo)	ANSA,
tel:	+44 223 323 010				Poseidon House,
fax:	+44 223 359 779				Castle Park,
						Cambridge CB3 0RD, UK
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