This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sobolevn
Recipients sobolevn
Date 2021-10-22.15:42:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634917363.52.0.444019325273.issue45574@roundup.psfhosted.org>
In-reply-to
Content
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 :)
History
Date User Action Args
2021-10-22 15:42:43sobolevnsetrecipients: + sobolevn
2021-10-22 15:42:43sobolevnsetmessageid: <1634917363.52.0.444019325273.issue45574@roundup.psfhosted.org>
2021-10-22 15:42:43sobolevnlinkissue45574 messages
2021-10-22 15:42:43sobolevncreate