Quote Originally Posted by Luanah
There is a main difference in glEnd; and glEnd();

:-( the first is total rubbish and the second ... oh man...

Why didn't my compiler tell me? This had to be a syntax error
Actually no. The first isn't an error in the C/C++ languages, though it isn't what you want. It's just a function (void glEnd()), which used as a value, evaluates as a function pointer. Values are valid on their own in C/C++.

However, if you flip compiler warnings on -- i.e. tell it to Warn on all "weird code" permutations it knows about (almost always developer goofs) -- e.g. add -Wall to the command line with gcc -- then you'll get something like this:

tst.cxx:5: warning: statement is a reference, not call, to function 'glEnd'
tst.cxx:5: warning: statement has no effect


I'd highly recommend gcc folks compile with -Wall -Werror, which says "look for weird stuff" and "treat this stuff as a hard compiler error, not just a warning".

If you're not using gcc, find out what the equivalent is with your compiler. If you can't make your compiler generate warnings for this, then ditch it and get a real compiler.