[Python-Dev] Compiler warnings for 64-bit portability problems

Neal Norwitz nnorwitz at gmail.com
Sun Jan 8 01:58:30 CET 2006


On 1/6/06, von Löwis Martin <Martin.vonLoewis at hpi.uni-potsdam.de> wrote:
> I just found that the intel compiler (icc 9.0)
> also supports compiler warnings for portability
> problems.

Cool.  Thanks for the info.  It would be nice if Intel would provide
Python developers with a permanent icc license for Python.  Can anyone
help with that?

> 4. don't try the Intel install.sh, it won't work
>    (atleast, it didn't work for me)

I don't follow directions very well (I'm also a doubter), so I had to
try it myself. :-)
It worked for me on gentoo amd64 non-root install.

I needed to set LD_LIBRARY_PATH to ~/intel/cce/9.0/lib, but otherwise
it was pretty painless.

This worked:  CC=icc ./configure --without-cxx
But I think this should work too: CC=icc CXX=icc ./configure

I've fixed a bunch of problems on HEAD.  I think I will move to ssize
branch since that will be a much bigger help.  I have some outstanding
modifications, but here are the results of make: 
http://python.org/neal/icc-warnings.txt

Summary (type, warning count, description):

warning.#170:    2 pointer points outside of underlying object
(obmalloc.c PT(0))
warning.#188:   14 enumerated type mixed with another type
warning.#810: 1478 conversion from "long" to "int" may lose significant bits
warning.#1418: 137 external definition with no prior declaration
warning.#1419:  53 external declaration in primary source file
warning.#1684: 285 conversion from pointer to same-sized integral type
(potential portability problem) -- all due to offsetof()

remark.#111:  121 statement is unreachable
remark.#177:    1 func "marshal_write_mod" was declared but never referenced
remark.#181:    9 arg is incompatible w/corresponding format string conversion
remark.#279:  862 controlling expression is constant
remark.#593:   17 variable set, but not used
remark.#869: 1317 parameter not used
remark.#981:  130 operands are evaluated in unspecified order
remark.#1469:  10 "cc" clobber ignored (wtf? use of htons() causes this msg)
remark.#1572: 111 floating-point equality/inequality comparisons are unreliable
remark.#1599:  30 declaration hides parameter

Note there are a lot of warning even when we mask off the higher bits
(e.g., x = y & 0xff still generats a warning if x is a char).

n


More information about the Python-Dev mailing list