[issue32711] Fix warnings for Python/ast_unparse.c

Christian Heimes report at bugs.python.org
Mon Jan 29 08:38:05 EST 2018


Christian Heimes <lists at cheimes.de> added the comment:

I'm getting slightly different warnings with GCC 7.2.1:

Python/ast_unparse.c: In function ‘append_formattedvalue’:
Python/ast_unparse.c:859:41: warning: ordered comparison of pointer with integer zero [-Wextra]
     if (e->v.FormattedValue.format_spec > 0) {
                                         ^
Python/ast_unparse.c: At top level:
Python/ast_unparse.c:1122:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 maybe_init_static_strings()
 ^~~~~~~~~~~~~~~~~~~~~~~~~
Python/ast_unparse.c: In function ‘append_ast_expr’:
Python/ast_unparse.c:23:16: warning: ‘op’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return _PyUnicodeWriter_WriteASCIIString(writer, charp, -1);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python/ast_unparse.c:119:17: note: ‘op’ was declared here
     const char *op;
                 ^~
Python/ast_unparse.c:23:16: warning: ‘op’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return _PyUnicodeWriter_WriteASCIIString(writer, charp, -1);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python/ast_unparse.c:79:17: note: ‘op’ was declared here
     const char *op;

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32711>
_______________________________________


More information about the Python-bugs-list mailing list