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-36127: Fix compiler warning in _PyArg_UnpackKeywords(). by serhiy-storchaka · Pull Request #12353 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Mar 15, 2019 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Since nargs <= maxpos, nargs can be casted to int without lost.

https://bugs.python.org/issue36127

Sorry, something went wrong.

Uh oh!

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

All reactions
@serhiy-storchaka
bpo-36127: Fix compiler warning in _PyArg_UnpackKeywords().
fb69fd7
@serhiy-storchaka serhiy-storchaka added the skip news label Mar 15, 2019
@serhiy-storchaka
serhiy-storchaka requested a review from vstinner March 15, 2019 16:00
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Mar 15, 2019
@bedevere-bot bedevere-bot added the awaiting merge label Mar 15, 2019
@serhiy-storchaka
serhiy-storchaka merged commit 1b0393d into python:master Mar 16, 2019
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 16, 2019
@serhiy-storchaka
serhiy-storchaka deleted the getargs_warn2 branch March 16, 2019 17:45
vstinner
vstinner reviewed Mar 18, 2019
View reviewed changes
Comment thread Python/getargs.c

/* copy keyword args using kwtuple to drive process */
for (i = Py_MAX(nargs, posonly); i < maxargs; i++) {
for (i = Py_MAX((int)nargs, posonly); i < maxargs; i++) {

@vstinner vstinner Mar 18, 2019

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm not sure that this code is safe is nargs > INT_MAX. (int)(INT_MAX+1) gives 0, no?

Maybe write something like:

i = (nargs < INT_MAX) ? (int)nargs : INT_MAX;
i = Py_MAX(i, posonly);

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner vstinner mentioned this pull request Mar 18, 2019
bpo-36127: Fix _PyArg_UnpackKeywords() warning #12345
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments

Uh oh!

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

Assignees

No one assigned

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.

4 participants

@serhiy-storchaka @vstinner @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.