ANSIfication patches

Matthieu Herrb matthieu.herrb at laas.fr
Fri Feb 18 13:33:35 PST 2005


Adam Jackson wrote:
> There are a few patches sitting in bugzilla regarding converting old ugly 
> K&R-style code to ANSI:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=2560
> https://bugs.freedesktop.org/show_bug.cgi?id=2566
> 
> What are the issues to look out for here?  Can we pretty much assume that 
> non-API code is safe to convert and that the only dangerous areas would be 
> (say) Xlib?  And how does the implicit argument passing convention for K&R 
> differ from ANSI?  (Probably assumes 32-bit width everywhere, which really 
> only matters for float/double...)

These should be treated carefully. Changing a K&R declaration of a less 
than 32 bits integer parameter (or a float parameter) does change the 
actual type that is passed, and the size of the parameter. Some subtile 
breakage may happen. I generally prefer to change the parameter's type 
in the declaration to the one used after the K&R promotion.

> I'd really like for gcc to never tell me "function declaration is not a 
> prototype" ever again.

I've not looked at the dix diff in details. In the X server there are 
lots of pointers to functions which are used to  store references to 
functions with variables prototypes. These are hard to ansify properly.
-- 
					Matthieu



More information about the xorg mailing list