New submission from Nikita Sobolev <m...@sobolevn.me>:

Recently, GitHub started to show a new warning:

> Check warning on line 999 in Parser/tokenizer.c
> GitHub Actions / Address sanitizer
> Parser/tokenizer.c#L999
> ‘print_escape’ defined but not used [-Wunused-function]

Link: 
https://github.com/python/cpython/pull/29158/files#file-parser-tokenizer-c-L999

I guess this happens because `print_escape` is only used when `Py_DEBUG` is set:

```
#if defined(Py_DEBUG)
        if (Py_DebugFlag) {
            printf("line[%d] = ", tok->lineno);
            print_escape(stdout, tok->cur, tok->inp - tok->cur);
            printf("  tok->done = %d\n", tok->done);
        }
#endif
```

Will this be a proper fix? Or do we need it for some other reason?

```
#if defined(Py_DEBUG)
static void
print_escape(FILE *f, const char *s, Py_ssize_t size)
// ...
# endif
```

If it's fine, I will send a PR :)

----------
messages: 404786
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Warning: ‘print_escape’ defined but not used

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

Reply via email to