[comp.sys.amiga.tech] Lattice 5.02 stdlib.h problems

wall@zodiac.rutgers.edu (02/14/90)

     I was using Lattice 5.02 and I was compiling a program like the 
following:

#include <stdio.h>
#include <stdlib.h>

..

main()
{
	....
   The compiler kept giving me a return type not defined for main.  I traced
this to some lines in stdlib.h which typed main as 'void'.  (As well 
as defining its parameters argc and argv)  My question is, is this right?
I've never seen main typed in ANY of the other headers, so why here?  Is
there some reason?  I've used compilers on other machines that do not
type main at all in any of the headers.  What's going on?

				Thanks a lot,
				  Sean Wall
				(WALL@CANCER)

justus@tko-sony-8.hut.fi (Juhana R{s{nen) (02/15/90)

In article <575.25d83771@zodiac.rutgers.edu> wall@zodiac.rutgers.edu writes:
>
>   The compiler kept giving me a return type not defined for main.  I traced
>this to some lines in stdlib.h which typed main as 'void'.  (As well 
>as defining its parameters argc and argv)  My question is, is this right?

You're right. I had similar problems with my 5.02.

>I've never seen main typed in ANY of the other headers, so why here?  Is
>there some reason?  I've used compilers on other machines that do not
>type main at all in any of the headers.  What's going on?

I don't think there's any particular reason for the prototype to be there
(and as far as I recall, it has been removed in 5.04). Your program should
work all right if you remove the prototype.

>				Thanks a lot,
>				  Sean Wall
>				(WALL@CANCER)

	Juhana R{s{nen / niksula.hut.fi