I'm tearing my hair out with a problem at the moment. I've managed to reduce it to a very simple example below:
Code:
#include <signal.h>
struct sigaction action;
if you try compiling this as with:
Code:
gcc -ansi test.c -c
it prints:
Code:
test.c:3: error: storage size of `action' isn't known
if I try with it all compiles fine.
The problem is I really need to use sigaction, and from the man pages it looks like the only way to use it is for me to declare the struct somewhere, and I also really need to use -ansi to force it to use the ANSI C 89 standard (part of the requirements). I thought that using -ansi wouldn't get in the way of using sigaction because sigaction is a POSIX system call. I'm also puzzled as to how if it doesn't know how big it is it could possibly compile in the first place. Is it possible to use sigaction with gcc -ansi, and if yes how?
Thanks,
Alan