Compiler warnings unnecessarily caused by X11 headers

Peter Breitenlohner peb at
Tue Sep 29 06:33:34 PDT 2009


it may be useful to compile programs with
 	gcc -Wall -Wwrite-strings -Wcast-qual
but unfortunately doing this causes numerous compiler warnings when defining
X11 resources.  Attached is a small example resulting in 13 warnings
 	8 initialization discards qualifiers...
 	5 cast discards qualifiers...

All this is due to struct members declared as 'char *' or (char *) casts,
that actually should be 'const char *' or maybe '_Xconst char *'.

I'd think that it is about time to make these changes (knowing well that
they will imply corresponding changes in many other declarations).

Doing this right will, however, also be a good check that these string are
not modified by the X11 library code.

Peter Breitenlohner <peb at>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: play.c
URL: <>

More information about the xorg mailing list