Is void main(void) ANSI standard??

SQUID 6 on the DARK side hooverm at sysjj.mdcbbs.com
Mon Mar 11 18:54:39 AEST 1991


This is my first posting to this group ( I read the FAQ first!!).

My question is basic and regarding the function main().

When a program is compiled/linked and there is no value returned to main,
certain platforms will return a warning message stating that this function
doesn't return a value.

I thought that by declaring:  void main(void)  that I would get around this.

Is this ANSI standard?  If it is valid, why doesn't my SUN SparcStation like
it?  Is it possible to write code that will not kick out ANY warning messages
when compiled, regardless of the platform or error message level??  I write for
Borland (PC), UNIX (HP & SUN), as well as VMS (VAX) and this is giving me
fits!!

Please reply by E-Mail and I will summarize if there is sufficient interest.


			Mark  <o===6
			hooverm at mdcbbs.com



More information about the Comp.lang.c mailing list