NoXzema wrote: |
---|
I claimed that C89 and C90 (which are essentially the same thing), allowed "void main" only by the fact that it does not have anything stating that it's not allowed. I'm not saying it's the most correct, I'm not saying it should be allowed, only that in C89/C90, it was not illegal to have a main function that had no return value. |
Bjarne wrote: |
---|
5.1.2.2.1 Program startup 1 The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int and with no parameters: int main(void) { /* ... */ } or with two parameters (referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared): int main(int argc, char *argv[]) { /* ... */ } or equivalent;9) or in some other implementation-defined manner. It seems clear to me and it reflects what has been the case since the days of Dennis Ritchie (before the C89 standard, I simply looked in K&R and/or asked him). |
Bjarne wrote: |
---|
Back in the 1980s the programming world was less legalistic. If someone genuinely wanted to know, they could have asked the committee or DMR is it was an oversight. I did ask DMR (about many things). Compilers don't settle such issues because as soon as one compiler have had a bug, it - and its - competitors - maintain compatibility flags forever. There exists modern C++ compilers with -ARM flags for compatibility with all the bugs I had in 1989 :-( |