GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c by ZackerySpytz · Pull Request #14814 · python/cpython

Conversation

@ZackerySpytz

@ZackerySpytz ZackerySpytz commented Jul 17, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Commit b1263d5 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.

Objects/descrobject.c:1050:19: warning: cast between incompatible function types from ‘PyObject * (*)(mappingproxyobject *, PyObject * const*, Py_ssize_t)’ {aka ‘struct _object * (*)(struct <anonymous> *, struct _object * const*, long int)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
 1050 |     {"get",       (PyCFunction)mappingproxy_get,        METH_FASTCALL,
      |                   ^

https://bugs.python.org/issue37337

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnprice reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@ZackerySpytz
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c
ec792a1
Commit b1263d5 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jul 17, 2019
@bedevere-bot bedevere-bot added the awaiting review label Jul 17, 2019
jdemeyer
jdemeyer approved these changes Jul 18, 2019
View reviewed changes
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Jul 18, 2019
@methane methane added the skip news label Jul 18, 2019
@ZackerySpytz

ZackerySpytz commented Jul 28, 2019

Copy link
Copy Markdown
Contributor Author

@methane

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZackerySpytz

ZackerySpytz commented Aug 13, 2019

Copy link
Copy Markdown
Contributor Author

Hi, @methane. Can you please merge this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@methane

methane commented Aug 14, 2019

Copy link
Copy Markdown
Member

The cast seems too complex to just avoid the warning. But I'm not sure there is a better way.
When I have spare time, I'll try to find simpler ways to fix this. But I don't have spare time now.
That's why I don't merge this.

If you want to this merged, please provide all casts you tried and demonstrate this is the simplest way to fix the warning.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer

jdemeyer commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

This is the standard way to avoid those warnings, there are many places in CPython with casts like that. It's also documented to do this: https://docs.python.org/3.8/extending/extending.html#keyword-parameters-for-extension-functions

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer

jdemeyer commented Aug 14, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

See bpo-33012 for the discussion about those casts.

As far as I know, this is indeed the simplest way to cast between incompatible function pointers which does not generate warnings with GCC 9 and which does not rely on undefined behaviour and which is compatible with C++.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@methane

methane commented Aug 14, 2019

Copy link
Copy Markdown
Member

OK, thank you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@methane methane added the needs backport to 3.8 label Aug 14, 2019
@methane
methane merged commit 43d564c into python:master Aug 14, 2019
@miss-islington

miss-islington commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

Thanks @ZackerySpytz for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting core review label Aug 14, 2019
@miss-islington

miss-islington commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

Sorry, @ZackerySpytz and @methane, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 43d564c18c97421f73025ac3132a194975c76bd6 3.8

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned methane Aug 14, 2019
@methane methane removed the needs backport to 3.8 label Aug 14, 2019
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
@ZackerySpytz @lisroach
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (pythonGH-14814)
e6a42a1
Commit b1263d5 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
@ZackerySpytz @DinoV
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (pythonGH-14814)
9b28a60
Commit b1263d5 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
@ZackerySpytz @websurfer5
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (pythonGH-14814)
e50c420
Commit b1263d5 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.
@jstasiak jstasiak mentioned this pull request May 30, 2024
ipaddress: Shared Address Space (100.64.0.0/10) is neither private nor global #119812
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jdemeyer jdemeyer jdemeyer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@methane methane

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@ZackerySpytz @methane @jdemeyer @miss-islington @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.