[Python-Dev] Objects/bufferobject.c

Gareth McCaughan gmccaughan at synaptics-uk.com
Thu Mar 25 10:54:00 EST 2004


On Thursday 2004-03-25 15:39, Guido van Rossum wrote:

["Hyperdivision":]
> > i'm using gcc-cvs and i get "invalid lvalue..."
> > in Objects/bufferobject.c, line 46
> > i fix this by deleting the cast to char on the left side of =
> > (my c's not so sharp, so i'm not sure this is the way to fix it)
> > but i just wanted to point out the problem hoping someone
> > might know what to do with it...

[Guido:]
> Hm, the GCC I have likes this just fine.  It seems you are using a
> bleeding edge GCC version.  Maybe you can take this up with the GCC
> developers?  It could be a bug there...

According to the draft C9x standard (the only C standard
I have to hand), "a cast does not yield an lvalue". I think
that line should say

    *ptr = (void*)((char *)*ptr + offset);

which I assume is the intended meaning.

-- 
g




More information about the Python-Dev mailing list