Python 2.3C1 Fails to build ?

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Mon Jul 28 02:10:44 CEST 2003


On Fri, 25 Jul 2003 02:01:10 -0400, rumours say that "Tim Peters"
<tim.one at comcast.net> might have written:

>>    PT(0), PT(1), PT(2), PT(3), PT(4), PT(5), PT(6), PT(7)
>>    ^
>>
>> Total errors detected in Objects/obmalloc.c: 2
>> make: *** [Objects/obmalloc.o] Error 1
>> ~~~~~~~~~~~~~~
>>
>> Any ideas what is going on?
>
>I'm surprised this hasn't triggered a (bogus) error on some other platform
>before!

This does trigger a warning on SGI MIPSPro compilers:

cc-1167 cc: WARNING File = Objects/obmalloc.c, Line = 371
  Pointer points outside of underlying object.

        PT(0), PT(1), PT(2), PT(3), PT(4), PT(5), PT(6), PT(7)
        ^

I never bothered to report it as a Python bug (or a patch: see later)
since things work fine; I am sure other Irix users noticed that too.

As Martin says, the macro PT(0) expands to twice PTA(0):

((poolp )((uchar *)&(usedpools[2*(0)]) - 2*sizeof(block *)))

C defines that

a[i] == *(a+i) {btw: == *(i+a) == i[a] but it's irrelevant}

so, assuming that MIPSPro don't like returning addresses before the one
usedpools points to, I just tried

#define PTA(x)  ((poolp )((uchar *)(usedpools+2*(x)) - 2*sizeof(block
*)))

ie I used (a+i) instead of &(a[i]), just in case I could fool the
compiler.  No success, of course, the warning was still thrown, because
usedpools *is* an array pointer --it's not just a pointer-- and PT(0)
points to memory *before* usedpools.

Anyway, the source comments declare that PT(0) is indeed an "invalid"
address, so the programmer is aware.  MIPSPro and UNICOS cc aren't that
mistaken in giving a warning/error, but it's a bug only if usedpools[0]
or usedpools[1] ever get used as pointers; it seems they are not
(guessing by Python working correctly).

Now, Holden: although there could be some connection between Cray and
SGI C compilers, I am afraid I can't help more; you could try cc options
about what is an error and what is a warning... the manuals should be
your friend.
-- 
TZOTZIOY, I speak England very best,
Microsoft Security Alert: the Matrix began as open source.




More information about the Python-list mailing list