Skip to content

gh-161625: Fix compiler warnings in 32-bit mode - #161631

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:fix_more_32b_warnings
Nov 8, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:fix_more_32b_warnings

Conversation

@vstinner

@vstinner vstinner commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Fix warnigs:

  • Include/internal/pycore_global_objects_fini.h:45:51: warning: comparison of integer expressions of different signedness: 'digit' {aka 'unsigned int'} and 'long int' [-Wsign-compare]
  • Modules/_testlimitedcapi/heaptype_relative.c:71:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  • Objects/moduleobject.c:412:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  • Objects/moduleobject.c:474:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  • Python/getopt.c:163:49: warning: format '%lc' expects argument of type 'wint_t', but argument 3 has type 'wchar_t' {aka 'long int'} [-Wformat=]
  • Python/getopt.c:177:55: warning: format '%lc' expects argument of type 'wint_t', but argument 3 has type 'wchar_t' {aka 'long int'} [-Wformat=]

In getopt.c, pass wint_t instead of wchar_t to printf("%lc").

Fix warnigs:

* Include/internal/pycore_global_objects_fini.h:45:51: warning:
  comparison of integer expressions of different signedness:
  'digit' {aka 'unsigned int'} and 'long int' [-Wsign-compare]
* Modules/_testlimitedcapi/heaptype_relative.c:71:28: warning: cast
  from pointer to integer of different size [-Wpointer-to-int-cast]
* Objects/moduleobject.c:412:38: warning: cast from pointer to
  integer of different size [-Wpointer-to-int-cast]
* Objects/moduleobject.c:474:44: warning: cast from pointer to
  integer of different size [-Wpointer-to-int-cast]
* Python/getopt.c:163:49: warning: format '%lc' expects argument of
  type 'wint_t', but argument 3 has type 'wchar_t' {aka 'long int'}
  [-Wformat=]
* Python/getopt.c:177:55: warning: format '%lc' expects argument of
  type 'wint_t', but argument 3 has type 'wchar_t' {aka 'long int'}
  [-Wformat=]

In getopt.c, pass wint_t instead of wchar_t to printf("%lc").
@vstinner
vstinner merged commit eba2a21 into python:main Nov 8, 2026
57 checks passed
@vstinner
vstinner deleted the fix_more_32b_warnings branch November 8, 2026 19:38
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