[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Lewis Hyatt changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #13 from Lewis Hyatt --- (In reply to Vadim Zeitlin from comment #12) > Thanks for looking at this! I'm happy to hear that the problem is fixed in > 11.2, but I'm probably not going to change our code anyhow, especially as > we're going to finally drop support for C++98 very soon and so will be able > to just use "override" unconditionally anyhow. > > I.e. from my point of view there is no real problem any more, I just replied > here to give more information about the problem in case it could be useful. Thanks, yes it was useful. Hopefully, issues with warning suppression will be increasingly rare going forward.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 --- Comment #12 from Vadim Zeitlin --- Thanks for looking at this! I'm happy to hear that the problem is fixed in 11.2, but I'm probably not going to change our code anyhow, especially as we're going to finally drop support for C++98 very soon and so will be able to just use "override" unconditionally anyhow. I.e. from my point of view there is no real problem any more, I just replied here to give more information about the problem in case it could be useful.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 --- Comment #11 from Lewis Hyatt --- (In reply to Vadim Zeitlin from comment #10) > There definitely was a change in behaviour in gcc 11 because I had to make > this change > > https://github.com/wxWidgets/wxWidgets/commit/ > 95c98a0b5ff71caca6654327bf341719c6587766 Thanks for that. I made a bisectable test that compiles allheaders.cpp (without your GCC 11-specific workaround in place) and counts the number of -Wsuggest-override warnings, which does indeed change in GCC 11.1 vs older and newer versions. The bisect confirmed that this issue was the same as that of PR100796. It existed only in GCC 11.1, as it was introduced by r11-7179 and was fixed by r12-1538, which was also backported to GCC 11.2. This particular issue only materializes with a sufficiently large source file, so I don't think you should find any "reasonably" sized testcase to reproduce it. All basic examples I tried work fine in 11.1 as well. As far as I can tell, I think your workaround should be needed only for sufficiently large translation units (approx 10 lines or more), not for typical size user code, and I think it should be needed only for 11.1 and no other version. If you know otherwise, please advise... otherwise, I think this is resolved.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 --- Comment #10 from Vadim Zeitlin --- There definitely was a change in behaviour in gcc 11 because I had to make this change https://github.com/wxWidgets/wxWidgets/commit/95c98a0b5ff71caca6654327bf341719c6587766 to avoid getting warnings with it that we didn't get with the previous versions. The idea there is that we define some macros whose expansion contains declarations of overridden virtual functions, which inevitably results in -Wsuggest-override when used in user classes using or not using "override" for their other functions, so we have to disable this warning locally. wxWARNING_SUPPRESS_MISSING_OVERRIDE, which expands to _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") worked for this until gcc 11 but not with it.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Lewis Hyatt changed: What|Removed |Added CC||lhyatt at gcc dot gnu.org --- Comment #9 from Lewis Hyatt --- This was fixed by r9-1926 (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69558#c25) and is a dupe of that aspect of PR69558. I would suggest to mark this one resolved, however comment 8 brought up that there was potentially a change in behavior in GCC 11. Do you have an example test case that doesn't behave as you expect? If not, I would suggest to close this one, there has been a lot of progress on pragma locations and I believe most such issues are now fixed on GCC 13 master branch.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Vadim Zeitlin changed: What|Removed |Added CC||vz-gcc at zeitlins dot org --- Comment #8 from Vadim Zeitlin --- For the record: with gcc 11 this bug now affects the existing code using pragmas to locally suppress -Wsuggest-override, i.e. the warning is not suppressed any longer, even though it used to work in all versions since gcc 5, so not only this bug is still present, but it got worse in the latest version.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 FeRD changed: What|Removed |Added CC||ferdnyc at gmail dot com --- Comment #7 from FeRD --- (In reply to Eric Gallager from comment #5) > We should probably > choose one of the bugs in this web of related bugs and choose one to use as > the base bug and mark the rest as duplicates, but idk which one... If you're taking votes from the "peanut gallery", I vote this one, as it's the only one that even hints at a poorly-disseminated fact: That -no-integrated-cpp serves as an easy workaround for this issue on affected versions, at the slight expense of some additional compile time. In our own CMake project, we've added the following config, to great effect: Work around a GCC < 9 bug with handling of _Pragma() in macros See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9.0.0")) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-integrated-cpp") endif()
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Eric Gallager changed: What|Removed |Added See Also|https://gcc.gnu.org/bugzill |https://gcc.gnu.org/bugzill |a/show_bug.cgi?id=9128 |a/show_bug.cgi?id=91285 --- Comment #6 from Eric Gallager --- dang it, typoed one of the "See Also" entries...
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Eric Gallager changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=91669, ||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=90400, ||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=69558, ||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=9128 --- Comment #5 from Eric Gallager --- (In reply to Eric Gallager from comment #4) > (In reply to Andrew Pinski from comment #2) > > Confirmed. It only happens with the C++ front-end though. The exact same > > code does not warn with the C front-end. I think this might be the > > pre-ahead of time tokenizer that happens for the C++ front-end but does not > > happen for C. > > so related to bug 53431 then and bug 91669, bug 90400, bug 69558, bug 91285, etc. We should probably choose one of the bugs in this web of related bugs and choose one to use as the base bug and mark the rest as duplicates, but idk which one...
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=53431 --- Comment #4 from Eric Gallager --- (In reply to Andrew Pinski from comment #2) > Confirmed. It only happens with the C++ front-end though. The exact same > code does not warn with the C front-end. I think this might be the > pre-ahead of time tokenizer that happens for the C++ front-end but does not > happen for C. so related to bug 53431 then
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Eric Gallager changed: What|Removed |Added CC||federico.kircheis at gmail dot com --- Comment #3 from Eric Gallager --- *** Bug 89718 has been marked as a duplicate of this bug. ***
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Keywords||diagnostic Status|UNCONFIRMED |NEW Last reconfirmed||2012-12-09 Ever Confirmed|0 |1 --- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org 2012-12-09 00:31:40 UTC --- Confirmed. It only happens with the C++ front-end though. The exact same code does not warn with the C front-end. I think this might be the pre-ahead of time tokenizer that happens for the C++ front-end but does not happen for C.
[Bug c++/55578] Disabling warnings inside macro definition doesn't work
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added CC|ruboam at gmail dot com |dodji at gcc dot gnu.org --- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2012-12-05 13:07:38 UTC --- Maybe Dodji can have a look.