-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-30923: Silence fall-through warnings included in -Wextra since gc… #3157
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -3614,7 +3614,7 @@ _build_callargs(PyCFuncPtrObject *self, PyObject *argtypes, | |||
case (PARAMFLAG_FIN | PARAMFLAG_FOUT): | |||
*pinoutmask |= (1 << i); /* mark as inout arg */ | |||
(*pnumretvals)++; | |||
/* fall through to PARAMFLAG_FIN... */ | |||
/* fall through */ |
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.
Why existing comments are shortened?
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.
gcc only recognizes "fall through" (and a couple of other versions), but not that comment with additional words.
I only changed comments that aren't recognized.
@@ -4154,6 +4154,7 @@ expr_constant(struct compiler *c, expr_ty e) | |||
else if (o == Py_False) | |||
return 0; | |||
} | |||
/* fall through */ |
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.
Wouldn't be better to move this comment one line up, inside a block, and align it with if
and else
? And add "else" before "fall through".
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.
Agreed, but gcc doesn't recognize that. It's pretty inflexible.
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.
LGTM, thanks!
Thanks everyone! |
Just checking out the bot, this is fantastic. |
Thanks @skrah Seems like there was problem backporting. I will try this again. |
Sorry @skrah and @skrah, I had trouble checking out the backport branch.Please backport using cherry_picker on command line. |
Sorry, @skrah and @skrah, I could not cleanly backport this PR due to a conflict.Please backport using cherry_picker on command line. |
Okay, thanks! I suspected there would be too many conflicts. So let's not backport this, it isn't worth the trouble. |
…nce gcc-7.0 (#3518) * bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142) (cherry picked from commit d73a960) * bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157) (cherry picked from commit f432a32) * bpo-31275: Small refactoring to silence a fall-through warning. (#3206) (cherry picked from commit 138753c)
…c-7.0.
https://bugs.python.org/issue30923