ANSI C function declaration prototypes

rja rja at edison.GE.COM
Wed Jan 18 02:23:07 AEST 1989


I am trying to revise some code to make it more maintainable.
As part of this, I am trying to correctly have the code use
ANSI C function prototypes.  I've got a couple of questions
that I can't seem to find the answer to in references at hand.

1) How should I declare a function using prototypes when
   that function has no parameters ??
example:   int foo();

My compiler sees no parameters and generates a warning about
the lack of ANSI function prototypes.


2) How should I declare a function which truly returns nothing ?

   My first thought was to declare "void foo();" but that still
   causes my compiler to warn about a function with no return value
   when it compiles the function definition.


Perhaps these are cases where the programmer should just ignore the
compiler warnings, but I'd really like to have a minimum number
( preferably zero) of warnings.

 Ran
______________________________________________________________________________
         rja at edison.GE.COM      or      ...uunet!virginia!edison!rja  
     via Internet (preferable)          via uucp  (if you must)
______________________________________________________________________________



More information about the Comp.lang.c mailing list