Skip to content

gh-131296: Fix Windows build warnings - #131487

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:fix_win_warns
Mar 20, 2025
Merged

gh-131296: Fix Windows build warnings#131487
vstinner merged 1 commit into
python:mainfrom
vstinner:fix_win_warns

Conversation

@vstinner

Copy link
Copy Markdown
Member

Fix the following warnings:

  • Modules_io\fileio.c(1296,13): unused variable 'self'
  • Modules_io\winconsoleio.c(334,9): unused variable 'fd_is_own'
  • Modules\faulthandler.c(409,11): unused variable 'flags'
  • Modules\posixmodule.c(5699,9): unused variable 'pathError'
  • PC\winreg.c(2077,5): suggest braces around initialization of subobject
  • PC\winreg.c(34,13): unused variable 'errNotAHandle'
  • Python\fileutils.c(132,12): result of comparison of constant 1114111 with expression of type 'wchar_t' (aka 'unsigned short') is always false
  • Python\fileutils.c(58,21): unused variable 'INCOMPLETE_CHARACTER'
  • Python\sysmodule.c(2534,21): unused variable 'perf_map_state'

Fix the following warnings:
* Modules\_io\fileio.c(1296,13): unused variable 'self'
* Modules\_io\winconsoleio.c(334,9): unused variable 'fd_is_own'
* Modules\faulthandler.c(409,11): unused variable 'flags'
* Modules\posixmodule.c(5699,9): unused variable 'pathError'
* PC\winreg.c(2077,5): suggest braces around initialization of
subobject
* PC\winreg.c(34,13): unused variable 'errNotAHandle'
* Python\fileutils.c(132,12): result of comparison of constant
1114111 with expression of type 'wchar_t' (aka 'unsigned short') is
always false
* Python\fileutils.c(58,21): unused variable 'INCOMPLETE_CHARACTER'
* Python\sysmodule.c(2534,21): unused variable 'perf_map_state'
@vstinner

Copy link
Copy Markdown
MemberAuthor

Ah, these compiler warnings are from clang if I understood correctly: https://github.com/python/cpython/actions/runs/13967620949/job/39101561262?pr=131495

@zooba

Copy link
Copy Markdown
Member

these compiler warnings are from clang

Yeah, they will be. MSVC warnings have an error code, while clang is going to show the -W<name> option.

@chris-eibl has been working on clang-cl warnings. They aren't blocking, but probably do show things that are worth fixing. (I'm guessing we've just globally suppressed them on MSVC, as all of those do exist in MSVC.)

@chris-eibl

Copy link
Copy Markdown
Member

Yeah, see #131296
I think you've made some of my PRs I've created some days ago obsolete.
Maybe you've even fixed some more :)

In total, there have been still 40ish warnings before my PRs were merged.

How to proceed?

I'll look through yours and mine and will close the obsolete ones?

@chris-eibl

Copy link
Copy Markdown
Member

@vstinner: I think I've closed all the duplicates and rebased #131304. There is one more open and I plan to do some more - there are still some warnings, but feel free to take over :)

Can you update the issue title so it gets linked with #131296?

@vstinnervstinner changed the title Fix Windows build warningsgh-131296: Fix Windows build warningsMar 20, 2025
Sign up for freeto 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.

3 participants

@vstinner@zooba@chris-eibl