Skip to content

gh-162214: Define STRINGLIB_IS_UNICODE macro in Objects/bytes_methods.c - #162222

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:wundef_stringlib
Nov 18, 2026
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:wundef_stringlib

Conversation

@vstinner

@vstinner vstinner commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Fix compiler warnings when Python is built with -Wundef:

In file included from Objects/bytes_methods.c:386: Objects/stringlib/count.h:10:6: warning: 'STRINGLIB_IS_UNICODE' is not defined, evaluates to '0' [-Wundef]
10 | #if !STRINGLIB_IS_UNICODE || STRINGLIB_MAX_CHAR > 0x7Fu
| ^~~~~~~~~~~~~~~~~~~~
In file included from Objects/bytes_methods.c:388:
Objects/stringlib/find_max_char.h:4:6: warning:
'STRINGLIB_IS_UNICODE' is not defined, evaluates to '0' [-Wundef]
4 | #if !STRINGLIB_IS_UNICODE && STRINGLIB_SIZEOF_CHAR > 1
| ^~~~~~~~~~~~~~~~~~~~

…ethods.c

Fix compiler warnings when Python is built with -Wundef:

In file included from Objects/bytes_methods.c:386:
Objects/stringlib/count.h:10:6: warning: 'STRINGLIB_IS_UNICODE' is
not defined, evaluates to '0' [-Wundef]
   10 | #if !STRINGLIB_IS_UNICODE || STRINGLIB_MAX_CHAR > 0x7Fu
      |      ^~~~~~~~~~~~~~~~~~~~
In file included from Objects/bytes_methods.c:388:
Objects/stringlib/find_max_char.h:4:6: warning:
'STRINGLIB_IS_UNICODE' is not defined, evaluates to '0' [-Wundef]
    4 | #if !STRINGLIB_IS_UNICODE && STRINGLIB_SIZEOF_CHAR > 1
      |      ^~~~~~~~~~~~~~~~~~~~
@vstinner
vstinner enabled auto-merge (squash) November 18, 2026 21:10
@vstinner
vstinner merged commit f3c11aa into python:main Nov 18, 2026
54 checks passed
@vstinner
vstinner deleted the wundef_stringlib branch November 18, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant