J
jaysome
While looking at the source code for gcc today, I noticed that a
prototype for main() was declared. From gcc.c:
extern int main (int, const char **);
int
main (int argc, const char **argv)
{
....
I also noticed that several GNU utilities (e.g., gcov) also declare a
prototype for main().
The C standard says that, for main(): "The implementation declares no
prototype for this function". Did the GNU developers take that to mean
that the implementation declares no prototype for this function so you
must declare your own? I always thought that it is superfluous and
considered bad practice to declare such a prototype (especially in a
..c file, as in gcc.c).
Is there any reason why the gcc source code and other GNU utility
source code should declare a prototype for main()?
Regards
prototype for main() was declared. From gcc.c:
extern int main (int, const char **);
int
main (int argc, const char **argv)
{
....
I also noticed that several GNU utilities (e.g., gcov) also declare a
prototype for main().
The C standard says that, for main(): "The implementation declares no
prototype for this function". Did the GNU developers take that to mean
that the implementation declares no prototype for this function so you
must declare your own? I always thought that it is superfluous and
considered bad practice to declare such a prototype (especially in a
..c file, as in gcc.c).
Is there any reason why the gcc source code and other GNU utility
source code should declare a prototype for main()?
Regards