I am using gcc (Ubuntu 4.4.1-4ubuntu9) to compile a program that I'm writing, but it seems to vomit whenever it sees a // comment in my code, saying:
gcc
interface.c :##: error: expected expression before a/a token<
Does the gcc compile mode I'm using forbid // comments?
//
$ gcc -g -ansi -pedantic interface.c structs.h -c -I. -I/home/me/project/h
Why?
// comments are not allowed in old (pre 99) C versions, use /**/ (or remove the -ansi, that is a synonym for the C89 standard)
/**/
-ansi
2.1m questions
2.1m answers
60 comments
56.8k users