I'm tearing my hair out with a problem at the moment. I've managed to reduce it to a very simple example below:
if you try compiling this as with:Code:#include <signal.h> struct sigaction action;
it prints:Code:gcc -ansi test.c -c
if I try withCode:test.c:3: error: storage size of `action' isn't knownit all compiles fine.Code:gcc test.c -c
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



LinkBack URL
About LinkBacks


