Minor generated code fix in masearch.c
Brought to you by:
rwhaley,
tonyc040457
In masearch.c, the generated code has an incorrect form for the arguments of main -- main(int nargs, char **args[]) rather than main(int nargs, char **args). This doesn't hurt anything, since the routine doesn't use the arguments, but it violates the c99 standard.
Unlike the use of main without a type specifier, which also violates the c99 standard (and occurs a *lot* in the ATLAS code), the c99 compilers I'm using won't simply pass this error with a warning, but refuse to compile the generated code. The attached patch fixes this (and takes a tiny step toward c99 compliance by declaring main as int).
Minor generated code fix in masearch.c - patch for 3.9.32
Made the args change, not the int declaration. ATLAS is not targeted to C99. When I look through ATLAS, there is a lot of mixed usage (i.e., routines I've written recently declare int main, and older files use the classic main()).
Surely main() works in C99, since it was the *recommended* declaration in the older ANSI C?
Thanks,
Clint
The c99 standard requires int main(), although I don't know of a c99 compiler that has the guts to do anything more than emit a warning. Both of the forms allowed by c99 are also legal in c90 -- these are int main(void) and int main(int argc, char *argv[]). From the standard:
"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; or in some other implementation-defined manner."
Oh, I see what you are saying. Fixed.
Thanks,
Clint