-
#include <signal.h>
int main()
{
struct sigaction act, oldact;
return 0;
}
Dies with the message
Testgcc4.c: In function 'main ':
Testgcc4.c: 6: Error: storage size of 'act 'isn' t known
Testgcc4.c: 6: Error: storage size of 'oldact 'isn' t known
If I use-STD = c99 or -- ANSI?
GCC testgcc4.c compiles without problem but adding-STD = c99 or -- ANSI produces
The error message above (for any of gcc-3.4, gcc-4.0, gcc-4.1) but neither
ICC nor GCC on FreeBSD has a problem with-STD = c99 or -- ANSI
Sumarry:
Use-STD = gnu99 on Linux if you need some c99 functions (e.g. strtof) but also want to use functions like sigaction and strtok_r
GCC on Linux is stricter than GCC on FreeBSD (or ICC on either FreeBSD or Linux) concerning standards.
Gcc-STD = c99 on Linux means: * only * recognize funze specified in the standard (no sigaction, no strtok_r etc)
Gcc-STD = c99 on FreeBSD or ICC-STD = c99 on either FreeBSD or Linux means recognize functions specified in the standard. This corresponds more or less to-STD = gnu99 on Linux
PS. this trap seems to be quite common (e.g. discussions on Debian-glibc about the "fact" that strtof is completely broken on Linux ). I wocould be grateful if somebody cocould point me to a good overview describing what standards compliance means for various OS/compiler + options/standards
Combinations.