(e-mail address removed) said:
Agreed. (In C99, it has to be int main() at the very least, but in C90
main() is legal.)
Yes. Adding the return type makes it C99-conforming, and using the
prototype form is good style, but these are choices, not requirements.
<rant>
I have absolutely no idea why you persist in your anti-C99 crusade.
Have you tried putting the effort into lobbying the suppliers of the
compilers you use, instead of putting it into denigrating those who
point out the latest standard?
As for the use of prototype form being "good style" and not a
requirement, your attitude is questionable at best, dangerous at
worst.
A responsible professional programmer always has coding requirements,
whether they are the policy of the organization he/she works for, or
self-imposed.
It is possible even today that a professional C programmer has to
write or maintain code for a pre-standard compiler which does not
accept prototypes in declarations and definitions.
Other than that remote scenario, any C programmer who chooses to write
non-prototype function declarations and definitions, rejecting the
single most important language improvement in almost 25 years of
standardization efforts, is either ignorant or an egotistical prima
donna.
There are many reasons why so many software/firmware projects these
days are late, cancelled, seriously over budget, and/or riddled with
defects. Many of those reasons are beyond the control of the
programmer, but several of the major ones are not.
The majority of programmers (software engineers, whatever) do not
actually know the standard and specification of their programming
language, whether it is C or anything else. Of course that does not
apply to the majority of clc regulars, but we hardly represent the
average C programmer.
And the majority of programmers, regardless of language, do not know
who their real customer is. It is not the manager, the company, the
client, even the user. The real customer of computer source code is
programmers, whether it is the author at some time in the future, a
maintenance programmer who has to update the code, or participants in
code inspections.
There are very true "matters of style" in C programming. As an
example, where to put the braces is one of them, absent an
organization's coding guide. Whether to put in optional braces, is
not.
Sadly, one of the greatest impediments to better software is
programmers' egos.
</rant>