Hi
What is the best way to get rid of warnings which GCC spuriously raises
for inactive code branches, like in the following example?
const int c = 33;
int result = (c < 32) ? (1 << c) : 0;
// previous line raises "left shift count >= width of type" warning
In Visual Studio I would just selectively deactivate the warnings around
the affected code area.
Altenatively I could use an ugly fix like
int result = (c < 32) ? (1 << c*(c < 32)) : 0;
or branch out the code in separate template specializations. Is there
any better way to do this in GCC?
Regards,
Stephan