[issue30287] cpython and Clang Static Analyzer

Дилян Палаузов report at bugs.python.org
Sun May 7 05:20:37 EDT 2017


Дилян Палаузов added the comment:

I forgot to pass --with-pydebug to ./configure in order to consider also the asserts.  Here we go:

scan-build ./configure --enable-loadable-sqlite-extensions --enable-ipv6 --with-system-expat --with-system-libmpdec --with-pydebug
scan-build -o /home/didopalauzov/public_html/scan-build-python-3763ea865c make

The output, which has now 9 hints less, is at
  https://mail.aegee.org/dpa/scan-build-python-3763ea865c/

The assignments in Modules/socketmodule.c:1456 and Modules/_datetimemodule.c:2232 are correctly detected as superfluous.

In Objects/longobject.c/long_format_binary:

    default:
        assert(0); /* shouldn't ever get here*/
        bits = 0; /* to silence gcc warning */

I guess return -1 instead of bits=0 will silent both gcc and the static analyzer warning.

----------

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


More information about the Python-bugs-list mailing list