Re: Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- From: "hugo2" <obrhy8@xxxxxxxxx>
- Date: 9 Jul 2005 16:30:03 -0700
obrhy8[at]yahoo.com July 9, 2005
Dave Hansen wrote:
> An implementation (C compiler) is allowed to support any prototype for
> main that it likes, but it is only _required_ to support two. If you
> want your code to work on any given C compiler, the main you use must
> conform to one of those prototypes. Both of those require main to
> return an int.
>
> >
> >2. The error message I recieved was in plain english
> > but it gave me not a clue as to the nature of my
> > offence.
> >
> >Do you, Jacob, perhaps have a belief that all C programers
> >know everything, and if they make a mistake or commit an
> >error, that they did it 'on purpose' and therefore deserve
> >a pie or piece of pie in the face?
> >
> >I assure you, sir, the real world is not like that.
> >hugo ---
> >
> Jacob has promised to fix the message. But if you imagine that coming
> up with sensible error messages is in any way "easy," especially in a
> program such as a compiler, that has to deal sensibly (as it can) with
> any random input it might receive, you do indeed live in a world
> different from the rest of us.
I take your point. I myself have witten exception/error handling
code for a Javascript utility, but it was a much smaller and
simpler context. I do know that one must be well rested and
fed to write such code. If one is stressed out, tired at all,
physically or mentally, it is easy to make a bad job of it.
What I do not know is how much of the ~20 MB (installed)
is the actual front end of the compiler (the lexical analizer
and the parser), and how much of that is given to error code.
> The code you posted was in error. The error message clearly pointer
> to the declaration of "main" as a problem. That's far better than
> I've come to expect at least one commercial compiler (targetting an
> embedded 8-bit microcontroller) to provide.
I disagree. Only those 'in the know' whould understand the msg,
(it did *not* mention 'main') and they whouldn't make the mistake
in the first place. To me the msg was 'insane', it saw something
that wasn't there.
Here is perhaps a better, truer, error msg for the foke:
error:[file][line#] main illegal return type found 'void' expected
'int'
yours truly, hugo------
.
- References:
- Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- From: hugo2
- Re: Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- From: jacob navia
- Re: Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- From: hugo2
- Re: Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- From: Dave Hansen
- Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- Prev by Date: Re: Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- Next by Date: Re: lcc cvs server
- Previous by thread: Re: Error a:\t_mayn.c:12 illegal return type, found 'int' expected 'void'
- Next by thread: perhaps a little over the top
- Index(es):
Relevant Pages
|
|