[SDL] SDL_Image + XPM + GCC 4.2.1

Alvin alvinbeach at gmail.com
Thu Nov 22 05:43:37 PST 2007


Hello all,

I have upgraded my OS to openSUSE 10.3 which comes with:
   gcc (GCC) 4.2.1 (SUSE Linux)

When I compile my SDL app I get the error:
	font.xpm: 18: warning deprecated conversion from string constant to "char*"

The solution is to update the XPM font file (font.xpm) to declare the array 
as:
    start const char* font_xpm[]

where "const" was originally omitted.

The reason for my email is that IMG_ReadXPMFromArray, from SDL_image, takes 
a "char**" not a "const char**". I simply just "const_cast<char**>font_xpm" 
at the moment.

Should I be casting away the constness of font_xpm or is it simply the 
SDL_image library hasn't been updated to GCC 4.2.1?

I am using SDL_image 1.2.6-25

Thanks,

Alvin


More information about the SDL mailing list