[SDL] Const correctness for SDL video

Ryan C. Gordon icculus at icculus.org
Thu Feb 15 14:36:36 PST 2007


> Every modern compiler should print out a
> warning or an error. GCC does it, don't
> know if VC also.

In my experience with SDL, there're lots of platforms that don't have a 
"modern compiler."   :)


Also, the latest Platform SDK for Windows gives no warning for this in 
the SDL project files.

int testme(int y)
{
     if (y = 1)
         y = 0;
     return y;
}

If you crank it up from Warning Level 3 (what SDL uses) to Warning Level 
4 (the maximum), it'll warn you about it...but Warning Level 4 in 
Microsoft's compiler tends to flood you with useless warnings, so no one 
uses it...enabling Level 4 in SDL moves us from 0 warnings to 1550 warnings.

It's much stricter, in a bad way, than gcc's -Wall.

--ryan.



More information about the SDL mailing list