From: Rob Biedenharn Date: 2009-10-13T00:23:24+09:00 Subject: Re: Does ruby.h overrides C "enum"? I think you'll find your problem is due to a macro for NULL. Change your code from "NULL" to "kNULL": #include int main(void) { enum kk {kNULL=0, NS=1, URL=2}; } and your problem goes away. -Rob On Oct 12, 2009, at 10:52 AM, Iñaki Baz Castillo wrote: > El Lunes, 12 de Octubre de 2009, angico escribió: >> Are you sure the typo was only in the mail? If I copy and paste >> this code >> in a file and try to compile it, the compiler complains about the >> same >> error, because void is a reserved keyword in C. But when I change >> that >> "void(void)" into "main(void)" it compiles ok. > > ok, let's try it: > > file_a.c > ---------------- > int main(void) { > enum kk {NULL=0, NS=1, URL=2}; > } > ---------------- > > It compiles ok. > > > Now: > > file_b.c > ---------------- > #include > int main(void) { > enum kk {NULL=0, NS=1, URL=2}; > } > ---------------- > > $ gcc file_b.c > file_b.c: In function ‘main’: > file_b.c:3: error: expected identifier before ‘(’ token > > > > ¿?¿? > > PS: It seems to be a problem not related to Ruby. > > -- > Iñaki Baz Castillo > Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com