[ANNOUNCE] inputproto 1.4.1

Alan Coopersmith alan.coopersmith at sun.com
Thu Feb 15 08:18:01 PST 2007


Tiago Vignatti wrote:
> Daniel Stone escreveu:
>> Thanks to Peter for catching a small, stupid, and critical, typo.
>>
>> Peter Hutterer (1):
>>       Fix typo in DevicePresence() macro
>>
> 
> diff --git a/XInput.h b/XInput.h
> index e4066b1..e3585b4 100644
> --- a/XInput.h
> +++ b/XInput.h
> @@ -151,7 +151,7 @@ #define NoExtensionEvent(d,type,_class)
> 
>  #define DevicePresence(dpy, type, _class)                       \
>      {                                                           \
> -        extern int_XiGetDevicePresenceNotifyEvent(Display *);   \
> +        extern int _XiGetDevicePresenceNotifyEvent(Display *);  \
>          type = _XiGetDevicePresenceNotifyEvent(dpy);            \
>          _class =  (0x10000 | _devicePresence);                  \
> 
> 
> The question is: why the compiler does not emit an error here?

Presumably because it was valid pre-ANSI C, in which it would have
assumed an implicit return type of int for the function named
int_XiGetDevicePresenceNotifyEvent.   All modern compilers should
warn about it, but X still has lots of warnings and pre-ANSI code,
so one more isn't always seen.


-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg mailing list