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-120593: Fix const qualifier in pyatomic.h#121055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:mainfromvstinner:pyatomic_fix_const
Jun 26, 2024

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedJun 26, 2024
edited by bedevere-appbot
Loading

colesbury reacted with hooray emoji
@vstinner
Copy link
MemberAuthor

This PR fix the following warnings:

/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h: In function ‘_Py_atomic_load_ptr’:/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h:300:34: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]  300 | { return (void *)__atomic_load_n((void **)obj, __ATOMIC_SEQ_CST); }      |                                  ^/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h: In function ‘_Py_atomic_load_ptr_relaxed’:/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h:359:34: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]  359 | { return (void *)__atomic_load_n((const void **)obj, __ATOMIC_RELAXED); }      |                                  ^/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h:359:10: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]  359 | { return (void *)__atomic_load_n((const void **)obj, __ATOMIC_RELAXED); }      |          ^/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h: In function ‘_Py_atomic_load_ptr_acquire’:/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h:493:34: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]  493 | { return (void *)__atomic_load_n((void **)obj, __ATOMIC_ACQUIRE); }      |                                  ^/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h: In function ‘_Py_atomic_load_uintptr_acquire’:/home/vstinner/python/main/Include/cpython/pyatomic_gcc.h:497:37: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]  497 | { return (uintptr_t)__atomic_load_n((uintptr_t *)obj, __ATOMIC_ACQUIRE); }      |                                     ^cc1: all warnings being treated as errorserror: command '/usr/bin/gcc' failed with exit code 1

@vstinner
Copy link
MemberAuthor

My previous attempt using(const void * const *) cast didn't work well. The correct cast is to(void * const *).

Copy link
Contributor

@colesburycolesbury left a comment

Choose a reason for hiding this comment

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

LGTM!

@vstinnervstinner merged commit9cd2dcb intopython:mainJun 26, 2024
39 checks passed
@vstinnervstinner deleted the pyatomic_fix_const branchJune 26, 2024 18:10
@miss-islington-app
Copy link

Thanks@vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 26, 2024
(cherry picked from commit9cd2dcb)Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

GH-121057 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJun 26, 2024
vstinner added a commit that referenced this pull requestJun 26, 2024
)gh-120593: Fix const qualifier in pyatomic.h (GH-121055)(cherry picked from commit9cd2dcb)Co-authored-by: Victor Stinner <vstinner@python.org>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull requestJun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@colesburycolesburycolesbury approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@vstinner@colesbury

[8]ページ先頭

©2009-2025 Movatter.jp