New submission from Christian Heimes <li...@cheimes.de>:

I'm seeing several compiler warnings in ubsan builds:

$ ./configure --with-address-sanitizer --with-undefined-behavior-sanitizer
$ make clean
$ make
Parser/string_parser.c: In function ‘decode_unicode_with_escapes’:
Parser/string_parser.c:98:17: warning: null destination pointer 
[-Wformat-overflow=]
   98 |                 sprintf(p, "\\U%08x", chr);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
Parser/string_parser.c:98:17: warning: null destination pointer 
[-Wformat-overflow=]
Parser/string_parser.c:98:17: warning: null destination pointer 
[-Wformat-overflow=]
In function ‘assemble_lnotab’,
    inlined from ‘assemble_emit’ at Python/compile.c:5697:25,
    inlined from ‘assemble’ at Python/compile.c:6036:18:
Python/compile.c:5651:19: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5651 |         *lnotab++ = k;
      |         ~~~~~~~~~~^~~
Objects/unicodeobject.c: In function ‘xmlcharrefreplace’:
Objects/unicodeobject.c:849:16: warning: null destination pointer 
[-Wformat-overflow=]
  849 |         str += sprintf(str, "&#%d;", PyUnicode_READ(kind, data, i));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Objects/unicodeobject.c:849:16: warning: null destination pointer 
[-Wformat-overflow=]
Objects/unicodeobject.c:849:16: warning: null destination pointer 
[-Wformat-overflow=]
Python/pylifecycle.c: In function ‘Py_FinalizeEx’:
Python/pylifecycle.c:1339:25: warning: unused variable ‘interp’ 
[-Wunused-variable]
 1339 |     PyInterpreterState *interp = tstate->interp;
      |

----------
components: Build
messages: 371712
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Compiler warnings in ubsan builds
type: compile error
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40998>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to