FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-131296: fix clang-cl parentheses warnings on Windows by chris-eibl · Pull Request #131905 · python/cpython · GitHub

/ cpython Public

GH-131296: fix clang-cl parentheses warnings on Windows - #131905

Merged
zooba merged 1 commit into
python:mainfrom
chris-eibl:fix_clangcl_parentheses
Mar 31, 2025
Merged

GH-131296: fix clang-cl parentheses warnings on Windows#131905
zooba merged 1 commit into
python:mainfrom
chris-eibl:fix_clangcl_parentheses

Conversation

chris-eibl commented Mar 30, 2025
edited
Loading

Copy link
Copy Markdown
Member

I think this is a skip news?

This might seem unneeded, but in the Linux code base, the same warning levels are active, but do not fire.
IMHO, it is better to have these warnings active in the Windows code base, too, and fix them.

Every mainstream compiler warns on this suspicious-looking code.

Comment thread Modules/_ssl.c
}

while (pCertCtx = CertEnumCertificatesInStore(hCollectionStore, pCertCtx)) {
while ((pCertCtx = CertEnumCertificatesInStore(hCollectionStore, pCertCtx))) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fix warning : using the result of an assignment as a condition without parentheses [-Wparentheses].

Comment thread Modules/_ssl.c
}

while (pCrlCtx = CertEnumCRLsInStore(hCollectionStore, pCrlCtx)) {
while ((pCrlCtx = CertEnumCRLsInStore(hCollectionStore, pCrlCtx))) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fix warning : using the result of an assignment as a condition without parentheses [-Wparentheses].

Comment thread Modules/posixmodule.c
{
if (!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) ||
!followLinks && IsReparseTagNameSurrogate(info.ReparseTag))
(!followLinks && IsReparseTagNameSurrogate(info.ReparseTag)))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fix warning : '&&' within '||' [-Wlogical-op-parentheses].

Comment thread PC/launcher2.c
exitCode = searchExitCode;
// If none found, and if permitted, install it
if (exitCode == RC_NO_PYTHON && isEnvVarSet(L"PYLAUNCHER_ALLOW_INSTALL") ||
if (((exitCode == RC_NO_PYTHON) && isEnvVarSet(L"PYLAUNCHER_ALLOW_INSTALL")) ||

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fix warning : '&&' within '||' [-Wlogical-op-parentheses].

chris-eibl changed the title GH-131296: fix "parentheses" clang-cl warnings on Windows GH-131296: fix clang-cl parentheses warnings on Windows Mar 30, 2025

zooba commented Mar 31, 2025

Copy link
Copy Markdown
Member

Eh, personally I think these make the code uglier, but there are so few changes that we may as well. Consistency between platforms is worth it.

zooba merged commit 7cbcb6e into python:main Mar 31, 2025
chris-eibl deleted the fix_clangcl_parentheses branch March 31, 2025 16:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL