Why does this code produce errors?:
Code:if (CLS_COLOR & clsmode) { clsflags += GL_COLOR_BUFFER_BIT; }error C2143: syntax error : missing ')' before ';'
This is a discussion on Bitwise and in an if statement? within the C++ Programming forums, part of the General Programming Boards category; Why does this code produce errors?: Code: if (CLS_COLOR & clsmode) { clsflags += GL_COLOR_BUFFER_BIT; } error C2143: syntax error ...
Why does this code produce errors?:
Code:if (CLS_COLOR & clsmode) { clsflags += GL_COLOR_BUFFER_BIT; }error C2143: syntax error : missing ')' before ';'
That if statement should be valid. Do you have more code?
No. MSVC also says:
CLS_COLOR is a constant.empty controlled statement found; is this the intent?
#define CLS_COLOR 1;
Last edited by JMK; 09-21-2010 at 05:21 PM.
I bet it's just checking to make sure you didn't mean && in this context. If so, I actually kind of like the warning. I don't see anything wrong with your code, though.
Ah! Remove the semi-colon from the macro. Should be:
Code:#define CLS_COLOR 1
Oh god. :|
Thanks.