-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Add -Wimplicit-fallthrough=0 to Makefile ? #75106
Comments
Hi all, Since I use the last version of Fedora 26 with gcc-7.1.1, I have these warnings (see output.txt file) We could add -Wimplicit-fallthrough=0 to Makefile ? it will disable the fallthrough of the coed. What do you think about that ? What's your feedback on this option and can we use it in the case of CPython ? Thank you |
It seems to me that by default the compiler recognizes a wide variety of "falls through" comments. Thus we need just add missed comments. There are warnings emitted when compile imported third-party code. We should ask Stefan for adding "falls through" comments in his libmpdec. And either compile expat with -Wimplicit-fallthrough=0, or wait until warnings will be fixed in upstream, or remove the bundled copy of expat. |
It's a useful warning, but I find it annoying to add 20 "fall through" comments. I may add a pragma at some point. |
Hmm, that took about 20 min to commit a 3 line diff. Now I'm watching the buildbots... |
Stéphane, if you want the libmpdec change cherry picked and are willing to do the (significant) work of backporting, I'll merge it. |
In fact I could create the PR for the backports, but I have again the same issues for the rest of CPython. I have checked your code, and in my case 'gcc' is in the cc string, 'gcc -pthread' and you have fixed for libmpdec. But for the other modules ? |
Hum, I don't think that it's worth it to backport changes which only fix warnings. Usually, we first focus on fixing all warnings on master. |
yep, currently, 3.6 and 3.5 are in 'bug fix' mode, and in this case, it's not a bug. |
Well, it's not a bug, but perhaps it is annoying for users of this gcc version if they compile 3.6 often. Actually, I think gcc should not include this warning in -Wextra. It's something that could be run manually before a release. I'd vote for making -Wno-implicit-fallthrough global. |
Stefan, ask on python-dev ml, or we have to ask to Ned Deily for this version ? |
I'm ok to kill warnings, but I would suggest to first fix most GCC7 warnings because starting to discuss backports. I expect that it will require multiple changes. |
I am not for a backport, it's not a security fix or a bug fix. for my case, I just want to "kill" the warnings, maybe we could check the version of gcc and add "-Wimplicit-fallthrough=0". Here is a good explanation of the 'fallthrough' in gcc7 |
Yeah the warnings are quit annoying when compiling the master and 3.6 branch. Fedora 26 currently includes gcc 7 which emits those warnings, other distros will follow up when they update gcc, so I'd think it would be better to fix it. |
We can check for the version, but all versions of gcc that I tested Of course they choke on -Wimplicit-fallthrough=0. |
I think the fall-through blog notes are slightly overstated. :-) "The switch fallthrough has been widely considered a design defect in C." It's an important feature. |
The following commit broke _decimal compilation on the "x86 Tiger 3.x" buildbot: commit 72b5433
http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/1068/steps/compile/logs/stdio building '_decimal' extension |
Thanks. I tried to revert it, but got: remote: Resolving deltas: 100% (2/2), completed with 2 local objects. So I'm supposed to spend 20 min creating an irrelevant PR to revert a 3 line diff?! I would never have finished _decimal under these conditions. |
So I installed gcc-7.2.0 from source. Hilariously compiling gcc *itself* Then I tried to be a good open source drone and add 20 /* fall through */ gcc is too stupid to recognize the /* fall through */ at the #endif Perhaps the author of this gcc warning wants to submit a patch. |
PR 3157 addresses everything apart from expat and https://github.com/python/cpython/blob/master/Modules/cjkcodecs/_codecs_iso2022.c#L816 I'm not sure about that one. It looks harmless but a bit odd. |
Cherry picking has too many conflicts, I'm not backporting this myself. |
All warnings except for bpo-31275 are dealt with. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: