[Python-bugs-list] Compile bug in CVS mmapmodule.c of 31 March (PR#258)

Guido van Rossum guido@python.org
Fri, 31 Mar 2000 12:48:00 -0500


> Compiling mmapmodule.c from CVS of 31 March 2000 on Tru64 Unix with Compaq C
> version Compaq C V6.1-110 (dtk) on Digital UNIX V4.0F  (Rev. 1229) produces
> the following errors:
> 
> cc  -O -Olimit 1500 -I./../Include -I.. -DHAVE_CONFIG_H -c ./mmapmodule.c
> cc: Error: ./mmapmodule.c, line 121: In this statement, "where" and "0" cannot
> be compared with a relational operator. (norelational)
>         if ((where >= 0) && (where < (self->data+self->size))) {
> -------------^
> cc: Warning: ./mmapmodule.c, line 620: In this statement, the referenced type
> of
> the pointer value "PyString_AsString(...)" is "char", which is not compatible
> with "unsigned char". (ptrmismatch)
>         buf = PyString_AsString(v);
> --------^
> cc: Warning: ./mmapmodule.c, line 643: In this statement, the referenced type
> of
> the pointer value "PyString_AsString(...)" is "char", which is not compatible
> with "unsigned char". (ptrmismatch)
>         buf = PyString_AsString(v);
> --------^

Mark, it seems that these can all be fixed with casts.  Can you
prepare a patch and mail it to patches@python.org?  If I do it, I
can't test that the patch actually works on your platform...

--Guido van Rossum (home page: http://www.python.org/~guido/)