FreeBSD 15.0 comes with GCC 14.2 compiler. This code,
produces an error at compilation time as the variable
in Linux using the GCC compiler. But in FreeBSD the GCC call with
C:
#include<stdio.h>
#include<math.h>
double y0;
int main()
{
printf("%lf\n",y0);
return 0;
}
y0 is declared as global, and y0 is the name of a function (one of the Bessel's functions) declared in math.h. If the variable is declared as local to the main() function, the code compiles without errors. But y0 function, although present in UNIX since late 70s and POSIX compliant, is not conformal with any C standard, so the presented code compiles with, for example,
Code:
gcc -std=c99 file.c -o file
-std=c99 flag also produces the same error as without it. So the question is, why the GCC version packed by FreeBSD does not show the same behavior in this case with -std=c99 as the Linux version?