(* func)(fred, bert)

D'Arcy Cain darcy at bbm.UUCP
Mon Nov 13 15:28:33 AEST 1989


In article <0175 at sheol.UUCP> throopw at sheol.UUCP (Wayne Throop) writes:
>> dg at lakart.UUCP (David Goodenough)
>>> VOID main()
>> void main()
>
>I is well worth mentioning (again) that it is NOT a good idea
>to lie to your compiler in this way.  The main routine of a C
>program is NOT void.  It returns an int.
>--
So what?  If you exit your program through some cleanup routine (perhaps
from a signal trap as well) then returning a value from main is an error
in the context of your program.  I use the GNU compiler with all the 
warning levels turned on and declaring main an int would cause a warning
in just about every program I have written since they don't return a value.
I don't think it is "lying" to your compiler to do this.  It is simply
declaring your exact intention of what you plan to do in main.

D'Arcy J.M. Cain
(darcy@{bbm,druid})



More information about the Comp.lang.c mailing list