calling a function without arguments

Mike Jones mjones at fenway.uucp
Sat Dec 23 02:59:08 AEST 1989


In article <1989Dec22.013757.3086 at sj.ate.slb.com> konath at vonneumann.UUCP (Kannan Konath) writes:
>I have the following program which does not generate any error messages
>from the compiler nor does it seem to output any assembly code for
>this particular case:
That's good, as there is no error in your example. Fact is, 
	foo;
is an entirely valid C statement with a different meaning from
	foo();
The first statement will evaluate to the address of foo(), which will
then be thrown away (as you haven't told the compiler to do anything
with it). A warning might be appropriate in this case, but it's
certainly not an error.
Mike Jones		|  When everything has been seen to work, all
AIX Kernel Development	|  integrated, you have four more months work to do.
Kingston, NY		|			- Charles Portman, ICL
	@cs.utexas.edu:ibmchs!auschs!fenway.aix.kingston.ibm.com!mjones



More information about the Comp.lang.c mailing list