Article View: gnu.gcc.bug
Article #191ANSI C or gcc bug? Problems with gcc-2.2.2
From: Cliff Krumvieda
Date: Fri, 24 Jul 1992 06:20
Date: Fri, 24 Jul 1992 06:20
49 lines
1721 bytes
1721 bytes
Howdy:
I'm having some trouble with the -Wmissing-prototypes flag on
gcc-2.2.2. I believe the following is correct ANSI C:
bug.c:
======================================================================
void bug ();
void bug ()
{
printf ("Hee!\n");
}
======================================================================
However, when I compile:
======================================================================
% gcc -v
Reading specs from /usr/local/gnu/gcc-2.2.2/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/
specs
gcc version 2.2.2
% gcc -c -Wmissing-prototypes bug.c
bug.c:4: warning: no previous prototype for `bug'
======================================================================
If instead:
bug2.c:
======================================================================
void bug2 (int);
void bug2 (int x)
{
printf ("%d!\n", x);
}
======================================================================
I get:
======================================================================
% gcc -c -Wmissing-prototypes bug2.c
%
======================================================================
Did I not specify a correct prototype in bug.c? If not, how does one
specify a prototype for a function without arguments?
--Cliff Krumvieda
Technical Details
Message-ID:
<9207241420.AA01236@ask.cs.cornell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.cornell.edu!cliffShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.cornell.edu!cliff From: cliff@cs.cornell.edu (Cliff Krumvieda) Subject: ANSI C or gcc bug? Problems with gcc-2.2.2 Message-ID: <9207241420.AA01236@ask.cs.cornell.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Fri, 24 Jul 1992 06:20:21 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 50