On Sat, 26 Jul 2003 18:12:15 +1000, Andrew Bevitt wrote:
>
>Ive just been trying to build the latest develoment snapshot (4.3.99.9)
>and have come across an error in the compiling.
>
>xf86DDC.c: In function `DDCRead_DDC2':
>xf86DDC.c:336: error: invalid lvalue in assignment
>make[6]: *** [xf86DDC.o] Error 1
>make[6]: Leaving directory 
>`/var/tmp/portage/xfree-4.3.99.9/work/xc/programs/Xserver/hw/xfree86/ddc'
>
>I cant seem to find much on this at all, except the offending code which is
>the line marked with !!!! in the following procedure from xf86DDC.c
>...   
>    xf86LoaderReqSymLists(i2cSymbols, NULL);
>
>!!!!    if (!dev = xf86I2CFindDev(pBus, 0x00A0)) {

I'm surprised that so many people offered off-the-wall suggestions on chasing 
this down.  The bang operator has a higher precedence than the equals 
operator, so this would have parsed as:

   if( (!dev) = xf86I2CFindDev(pBus, 0x00A0)) {

And, as the error message quite correctly states, it is not valid to assign a 
value to the expression "!dev".  I assume the fix (which Marc pointed to) was 
to fix the precedence this way:

   if( !(dev = xf86I2CFindDev(pBus, 0x00A0)) ) {

It's interesting to me that this got into the CVS at all.  Is there really a 
compiler which DOES compile the original line?  Such a compiler would not be 
ISO compliant.


--
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.


_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to