[New-bugs-announce] [issue27270] 'parentheses-equality' warnings when building with clang and ccache

Xavier de Gaye report at bugs.python.org
Wed Jun 8 15:47:43 EDT 2016


New submission from Xavier de Gaye:

Building Python with clang and ccache produces about 200 'parentheses-equality' warnings with the message:
    warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

It seems that clang does not recognize that these extraneous parentheses are valid [1] after a macro expansion because the preprocessing is done as a separate stage by ccache.

[1] For example:
With the macros:
    #define Py_TYPE(ob)           (((PyObject*)(ob))->ob_type)
    #define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type)
The statement:
    if (PyLong_CheckExact(v))
is expanded to:
    if (((((PyObject*)(v))->ob_type) == &PyLong_Type))
and produces the warning with ccache.

----------
components: Devguide
files: clang_ccache.patch
keywords: patch
messages: 267881
nosy: eric.araujo, ezio.melotti, ncoghlan, willingc, xdegaye
priority: normal
severity: normal
stage: patch review
status: open
title: 'parentheses-equality' warnings when building with clang and ccache
type: enhancement
Added file: http://bugs.python.org/file43309/clang_ccache.patch

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


More information about the New-bugs-announce mailing list