🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Cliff Krumvieda Fri, 24 Jul 1992 06:20
ANSI C or gcc bug? Problems with gcc-2.2.2
#191
Author: Cliff Krumvieda
Date: Fri, 24 Jul 1992 06:20
49 lines
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
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