Hi, On 03/03/2014 11:23 AM, Mark Kettenis wrote: >> From: Hans de Goede <hdego...@redhat.com> >> Date: Mon, 3 Mar 2014 09:53:12 +0100 >> >> This fixes the following compiler warning: >> >> xf86Config.c: In function 'checkCoreInputDevices': >> xf86Config.c:1136:18: warning: declaration of 'Pointer' shadows a global >> declaration [-Wshadow] >> InputInfoPtr Pointer, Keyboard; >> ^ >> In file included from xf86Xinput.h:57:0, >> from xf86Config.c:66: >> /opt/xorg/include/X11/extensions/XIproto.h:88:24: warning: shadowed >> declaration is here [-Wshadow] >> typedef unsigned char *Pointer; > > Your compiler is on drugs. Pointer is a typedef, which is a > completely different namespace from variable names.
No it is not, you're assuming the compiler can always infer which namespace it should use which it cannot, ie: (Pointer) -foo Is this casting -foo to a Pointer, or is this substracting the value in foo from the value in Pointer ? The compiler cannot know, so the 2 namespace do overlap in a way, and the shadowing can lead to unexpected results when a cast is intended and it becomes something else instead. Regards, Hans _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel