[New-bugs-announce] [issue10951] gcc 4.6 warnings

STINNER Victor report at bugs.python.org
Wed Jan 19 22:58:38 CET 2011


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

To analyze #9880, I installed gcc-4.6. It looks like this new gcc version emits new warnings. Here is a report of py3k warnings generated with "gcc-4.6 -O3 -Wall -Wextra -Wstrict-prototypes -Wno-missing-field-initializers -Wno-unused-parameter" on AMD64. I grouped manually  the warnings.

sign-compare:

Parser/node.c: In function 'PyNode_AddChild':
Parser/node.c:94:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/bytesobject.c: In function 'PyBytes_FromStringAndSize':
Objects/bytesobject.c:95:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/floatobject.c: In function 'PyFloat_ClearFreeList':
Objects/floatobject.c:1960:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/floatobject.c:1970:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/floatobject.c: In function 'PyFloat_Fini':
Objects/floatobject.c:2014:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/memoryobject.c: In function '_indirect_copy_nd':
Objects/memoryobject.c:199:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/tupleobject.c: In function 'PyTuple_New':
Objects/tupleobject.c:85:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/typeobject.c: In function 'PyType_FromSpec':
Objects/typeobject.c:2339:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/unicodeobject.c: In function '_PyUnicode_New':
Objects/unicodeobject.c:326:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/unicodeobject.c: In function 'PyUnicodeUCS2_AsWideCharString':
Objects/unicodeobject.c:1288:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/unicodeobject.c: In function 'PyUnicodeUCS2_DecodeFSDefaultAndSize':
Objects/unicodeobject.c:1804:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/unicodeobject.c: In function 'PyUnicodeUCS2_FSConverter':
Objects/unicodeobject.c:1851:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/unicodeobject.c: In function 'PyUnicodeUCS2_FSDecoder':
Objects/unicodeobject.c:1892:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Objects/unicodeobject.c: In function 'PyUnicode_AsUnicodeCopy':
Objects/unicodeobject.c:10336:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/asdl.c: In function 'asdl_seq_new':
Python/asdl.c:12:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/asdl.c: In function 'asdl_int_seq_new':
Python/asdl.c:43:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Parser/printgrammar.c: In function 'printdfas':
Parser/printgrammar.c:96:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Parser/pgenmain.c: In function 'getgrammar':
Parser/pgenmain.c:102:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/bltinmodule.c: In function 'source_as_string':
Python/bltinmodule.c:528:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/getargs.c: In function 'convertsimple':
Python/getargs.c:876:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/getargs.c:993:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/pythonrun.c: In function 'print_error_text':
Python/pythonrun.c:1352:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
./Python/sysmodule.c: In function 'svnversion_init':
./Python/sysmodule.c:1367:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/traceback.c: In function '_Py_FindSourceFile':
Python/traceback.c:191:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/dtoa.c: In function 'Balloc':
Python/dtoa.c:349:56: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Python/thread_pthread.h: In function 'PyThread_create_key':
Python/thread_pthread.h:592:22: warning: signed and unsigned type in conditional expression [-Wsign-compare]
Python/compile.c: In function 'compiler_import_as':
Python/compile.c:2076:49: warning: signed and unsigned type in conditional expression [-Wsign-compare]
Python/compile.c: In function 'assemble_init':
Python/compile.c:3619:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

unused-but-set-variable:

Parser/parsetok.c: In function 'parsetok':
Parser/parsetok.c:130:43: warning: variable 'handling_with' set but not used [-Wunused-but-set-variable]
Objects/obmalloc.c: In function '_PyObject_DebugMallocStats':
Objects/obmalloc.c:1778:14: warning: variable 'poolsinarena' set but not used [-Wunused-but-set-variable]
Objects/unicodeobject.c: In function 'replace':
Objects/unicodeobject.c:6932:29: warning: variable 'e' set but not used [-Wunused-but-set-variable]
Python/bltinmodule.c: In function 'builtin___build_class__':
Python/bltinmodule.c:40:23: warning: variable 'nbases' set but not used [-Wunused-but-set-variable]
Python/bltinmodule.c: In function 'builtin_exec':
Python/bltinmodule.c:769:9: warning: variable 'plain' set but not used [-Wunused-but-set-variable]
./Python/sysmodule.c: In function 'PySys_AddXOption':
./Python/sysmodule.c:1179:9: warning: variable 'r' set but not used [-Wunused-but-set-variable]
Python/thread_pthread.h: In function 'PyThread_free_lock':
Python/thread_pthread.h:294:17: warning: variable 'error' set but not used [-Wunused-but-set-variable]
Python/thread_pthread.h: In function 'PyThread_acquire_lock_timed':
Python/thread_pthread.h:325:17: warning: variable 'error' set but not used [-Wunused-but-set-variable]
Python/thread_pthread.h: In function 'PyThread_release_lock':
Python/thread_pthread.h:376:17: warning: variable 'error' set but not used [-Wunused-but-set-variable]
./Modules/_sre.c: In function '_validate_inner':
./Modules/_sre.c:2988:42: warning: variable 'prefix_skip' set but not used [-Wunused-but-set-variable]
./Modules/_sre.c:2966:38: warning: variable 'max' set but not used [-Wunused-but-set-variable]
./Modules/_sre.c:2966:33: warning: variable 'min' set but not used [-Wunused-but-set-variable]
./Modules/_io/bytesio.c: In function 'bytesiobuf_getbuffer':
./Modules/_io/bytesio.c:941:11: warning: variable 'ptr' set but not used [-Wunused-but-set-variable]

empty-body:

Parser/pgen.c: In function 'compile_rule':
Parser/pgen.c:174:28: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c: In function 'compile_rhs':
Parser/pgen.c:195:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c:210:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c: In function 'compile_alt':
Parser/pgen.c:228:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c: In function 'compile_item':
Parser/pgen.c:250:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c:253:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c:262:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c: In function 'compile_atom':
Parser/pgen.c:286:15: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
Parser/pgen.c:289:19: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
./Modules/_sre.c: In function '_validate':
./Modules/_sre.c:3194:31: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]

uninitialized:

Objects/setobject.c: In function 'test_c_api':
Objects/setobject.c:2445:11: warning: 'x' may be used uninitialized in this function [-Wuninitialized]
Python/Python-ast.c: In function 'obj2ast_expr':
Python/Python-ast.c:5824:24: warning: 'col_offset' may be used uninitialized in this function [-Wuninitialized]
Python/Python-ast.c:5824:24: warning: 'lineno' may be used uninitialized in this function [-Wuninitialized]
Python/Python-ast.c: In function 'obj2ast_stmt.part.15':
Python/Python-ast.c:4678:24: warning: 'col_offset' may be used uninitialized in this function [-Wuninitialized]
Python/Python-ast.c:4678:24: warning: 'lineno' may be used uninitialized in this function [-Wuninitialized]

(other):

./Python/sysmodule.c: In function 'svnversion_init':
./Python/sysmodule.c:1368:9: warning: offset outside bounds of constant string [enabled by default]
In file included from Python/thread.c:118:0:

----------
messages: 126571
nosy: haypo
priority: normal
severity: normal
status: open
title: gcc 4.6 warnings

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10951>
_______________________________________


More information about the New-bugs-announce mailing list