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

I'm getting a couple of compiler warnings with gcc-10.1.1 (Fedora 32) with an 
asan and ubsan build:

Parser/string_parser.c: In function ‘decode_unicode_with_escapes’:
Parser/string_parser.c:100:17: warning: null destination pointer 
[-Wformat-overflow=]
  100 |                 sprintf(p, "\\U%08x", chr);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
Parser/string_parser.c:100:17: warning: null destination pointer 
[-Wformat-overflow=]
Parser/string_parser.c:100:17: warning: null destination pointer 
[-Wformat-overflow=]

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=]

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;
      |         ~~~~~~~~~~^~~

----------
components: Build
messages: 371335
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: GCC overflow warnings (format-overflow, stringop-overflow)
type: compile error
versions: Python 3.10, Python 3.9

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

Reply via email to