[SDL] Demo glitch

Daniel Phillips phillips at arcor.de
Tue Jan 21 21:07:01 PST 2003


On Wed, Jan 08, 2003 at 01:11:56PM -0800, Peter Jay Salzman wrote:
> and the error messages that both gcc-3.0 and gcc-2.95 give:

(You mean warnings, not errors.)

>   p at satan% make
>   gcc -Wall -W -Wstrict-prototypes -Wmissing-prototypes
>   -Wmissing-declarations -Wtraditional -Wshadow -Wpointer-arith
>   -Wcast-qual -Winline -Wredundant-decls -Wconversion -Waggregate-return
>   -Wnested-externs -Wcast-align -Wwrite-strings blah.c `sdl-config --libs`
>   
>   blah.c: In function `main':
>   blah.c:10: warning: passing arg 2 of `SDL_MapRGB' with different width due to prototype
>   blah.c:10: warning: passing arg 3 of `SDL_MapRGB' with different width due to prototype
>   blah.c:10: warning: passing arg 4 of `SDL_MapRGB' with different width due to prototype

Turn off -Wconversion; it's not a warning you normally want on.

>   blah.c:10: warning: unused variable `white'
>   blah.c: In function `init_Video':
>   blah.c:23: warning: passing arg 3 of `SDL_VideoModeOK' as signed due to prototype
>   blah.c:24: warning: passing arg 3 of `SDL_SetVideoMode' as signed due to prototype

These are correct; "bpp" is prototyped as "int", not Uint32, so declare
bpp "int".  (I'm guessing that the prototypes use Uint32, etc. when the
exact size and signededness matters, and it doesn't really matter for
bits per pixel.)

-- 
Glenn Maynard




More information about the SDL mailing list