-Wimplicit_int & X11 headers

Marc Espie espie@quatramaran.ens.fr
Wed Apr 22 18:14:00 GMT 1998

I don't know if this was mentionned already, but compiling X11
programs with -Wall gives lots of spurious warnings.

The trouble is that many functions in X11 don't mention a return
type, e.g.,  in Xlib.h,
extern XAddHost(
/* ... */
so that activating -Wimplicit-int with -Wall will give rise to a
full load of warnings.

The problem is, I have some programs that I'd like to compile with
-Wall, but can't thanks to these includes.

This looks to me like something that should go into fixincludes.
I don't know how to do that the fixincludes way, but a simple perl line
perl -ip.bak -e 's/^extern\s+(\w+)\(/extern int $1(/' Xlib.h Xutil.h Xresource.h
made the fix for me.

It might also be that this is already done for some architectures,
but sparc-sun-solaris2.5 does not do it, as it only run fixinc.math.

Or maybe our X11 tree is too old...

More information about the Gcc-bugs mailing list