Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: expected expression before '/' token

Tags:

c

I'm no C expert, and am getting this error when trying to cross-compile a C application:

src/ls_sqlite3.c:522: error: expected expression before '/' token

The offending line is this:

sqlite3_busy_timeout(conn, lua_tonumber(L,3)); // TODO: remove this

I suspect the use of // for comments is not allowed by certain compilers or through some settings, but Google didn't help. Does someone know?

Thank you.

like image 263
Gulbahar Avatar asked Apr 14 '11 13:04

Gulbahar


2 Answers

In the old C standard only allowed comments are /*...*/. Only from C99 standards onwards // are allowed as comments.

like image 106
RedX Avatar answered Oct 18 '22 09:10

RedX


Since you didn't mention your compiler. You could change it to c-style comments

sqlite3_busy_timeout(conn, lua_tonumber(L,3)); /* TODO: remove this */

Check your compilers manual for a compatibility switch for c++ style comments.

like image 44
stacker Avatar answered Oct 18 '22 09:10

stacker