Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-131296: fix clang-cl warning on Windows in socketmodule.h#131832

Merged
zooba merged 1 commit intopython:mainfrom
chris-eibl:fix_clangcl_socketmodule.h
Jul 28, 2025
Merged

GH-131296: fix clang-cl warning on Windows in socketmodule.h#131832
zooba merged 1 commit intopython:mainfrom
chris-eibl:fix_clangcl_socketmodule.h

Conversation

@chris-eibl
Copy link
Member

@chris-eiblchris-eibl commentedMar 28, 2025
edited by bedevere-appbot
Loading

@@ -18,6 +18,10 @@
*/
#ifdef AF_BTH
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Strictly speaking, we're in the#else of#ifndef MS_WINDOWS here and we most probably should indent, but I wanted to keep the diff small.

# include <ws2bth.h>
# ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpragma-pack"
Copy link
MemberAuthor

@chris-eiblchris-eiblMar 28, 2025
edited
Loading

Choose a reason for hiding this comment

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

Fix clang-cl warning:

the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]

This will silence 16 occurrences inhttps://github.com/python/cpython/actions/runs/14044831663/job/39366560293?pr=131690#step:4:60.

Actually,pshpack1.h takes care of this warning

#if ! (defined(lint)|| defined(RC_INVOKED))#if (_MSC_VER >=800&& !defined(_M_I86))|| defined(_PUSHPOP_SUPPORTED)#pragma warning(disable:4103)#if !(defined(MIDL_PASS ))|| defined(__midl )#pragma pack(push,1)#else#pragma pack(1)#endif#else#pragma pack(1)#endif#endif/* ! (defined(lint) || defined(RC_INVOKED)) */

using#pragma warning(disable:4103), but clang-cl only supportsdisable for some warnings so far (and doesn't supportsuppress for those few supported, see also#131821 (comment)).

A different approach would be, to entirely get rid ofpshpack1.h, since we are in theMS_WINDOWS code path here. We could do a simple#pragma pack(push,1), which clang-cl understands and neither MSVC nor clang-cl would warn about, but

  • I wanted to do the minimal needed stuff to silence clang ...
  • ... without having to care about other compilers (mingw, etc), which might then be broken (seeAn include file is needed because various compilers do this in different ways inpshpack1.h)

};
# include <poppack.h>
#endif
# ifdef __clang__
Copy link
MemberAuthor

@chris-eiblchris-eiblMar 28, 2025
edited
Loading

Choose a reason for hiding this comment

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

Must be done afterpoppack.h, because there the previous packing is restored and we'd get the same[-Wpragma-pack] warning.

@python-cla-bot
Copy link

All commit authors signed the Contributor License Agreement.

CLA signed

@chris-eibl
Copy link
MemberAuthor

@zooba May I ask you for a review?

@zoobazooba merged commit59e2330 intopython:mainJul 28, 2025
45 checks passed
@chris-eiblchris-eibl deleted the fix_clangcl_socketmodule.h branchAugust 2, 2025 16:07
hunterhogan added a commit to hunterhogan/cpython that referenced this pull requestMar 14, 2026
@chris-eiblchris-eibl added the needs backport to 3.14bugs and security fixes labelMar 23, 2026
@miss-islington-app
Copy link

Thanks@chris-eibl for the PR, and@zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMar 23, 2026
…ythonGH-131832)(cherry picked from commit59e2330)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@bedevere-app
Copy link

GH-146340 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMar 23, 2026
@bedevere-app
Copy link

GH-146340 is a backport of this pull request to the3.14 branch.

ambv pushed a commit that referenced this pull requestMar 23, 2026
…H-131832) (GH-146340)(cherry picked from commit59e2330)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@chris-eibl@zooba@picnixz

[8]ページ先頭

©2009-2026 Movatter.jp