This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
C Preprocessor: Expected Declaration Specifiers
- From: "Ryan Slominski" <ryan dot slominski at gmail dot com>
- To: gcc-help at gnu dot org
- Date: Tue, 30 Jan 2007 10:49:06 -0500
- Subject: C Preprocessor: Expected Declaration Specifiers
Hello,
I am trying to port code from a Debian distribution with gcc version
3.4.4 to a Ubuntu distribution with gcc version 4.1.2. The code
compiles and runs on the Debian machine but fails to compile on the
Ubuntu with an error message I do not understand. Here is the output
of the compile:
rjslom@turbo-dog:~/msg$ make
gcc msg_client.c -o msg_client
In file included from msg_client.c:13:
msg_bmk.h:34: error: expected declaration specifiers or '...' before 'msgbmk'
msg_bmk.h:34: error: expected declaration specifiers or '...' before 'msqid'
msg_bmk.h:34: error: expected declaration specifiers or '...' before
'MSG_TRIALS'
msg_bmk.h:34: warning: data definition has no type or storage class
make: *** [msg_client] Error 1
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.
Thanks for you time,
Ryan