From 2a94efc379b53b7eb0bba7f4cd36353f6dd00e5b Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sat, 22 Mar 2025 21:39:55 +0100 Subject: [PATCH 1/2] fix warning : result of comparison of constant 128 with expression of type 'const char' is always true [-Wtautological-constant-out-of-range-compare] --- Modules/getpath.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/getpath.c b/Modules/getpath.c index e2478da021f511..a9aa0240027ca3 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -690,7 +690,6 @@ env_to_dict(PyObject *dict, const char *key, int and_clear) // Quick convert to wchar_t, since we know key is ASCII wchar_t *wp = wkey; for (const char *p = &key[4]; *p; ++p) { - assert(*p < 128); *wp++ = *p; } *wp = L'\0'; From 7275f2b3d6412ff2b1f65f4237ae2ecd7d18355d Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Mon, 21 Apr 2025 19:51:03 +0200 Subject: [PATCH 2/2] use assert(!(*p & 0x80)); --- Modules/getpath.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/getpath.c b/Modules/getpath.c index a9aa0240027ca3..1e75993480ae36 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -690,6 +690,7 @@ env_to_dict(PyObject *dict, const char *key, int and_clear) // Quick convert to wchar_t, since we know key is ASCII wchar_t *wp = wkey; for (const char *p = &key[4]; *p; ++p) { + assert(!(*p & 0x80)); *wp++ = *p; } *wp = L'\0';