C Preprocessor: Expected Declaration Specifiers

Michael Eager eager@eagercon.com
Sun Feb 4 02:41:00 GMT 2007


Ryan Slominski wrote:
> The code in question (line 34 of msg_bmk) is a preprocessor macro
> which is supposed to expand to a user stub for a new system call.
> Here is the line:
> 
> _syscall2( int, msgbmk, int, msqid, int, MSG_TRIALS )
> 
> The file msg_bmk.h includes the header file <linux/unistd.h> which
> contains the macro definition.
> 
> Any feedback would be great.

It's difficult to tell what the real problem is when looking
at macros.  You need to look at the code after macros have
been expanded.

Execute "gcc msg_client.c -E -dD -o msg_client.i" and take a
look at what the _syscall2 macro generates.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



More information about the Gcc-help mailing list