Deprecating arithmetic on std::atomic<void*>

Jonathan Wakely jwakely@redhat.com
Thu Apr 20 12:20:00 GMT 2017


On 20/04/17 12:20 +0100, Jonathan Wakely wrote:
>On 20/04/17 11:12 +0100, Jonathan Wakely wrote:
>>On 20/04/17 12:07 +0200, Jakub Jelinek wrote:
>>>On Thu, Apr 20, 2017 at 11:03:38AM +0100, Jonathan Wakely wrote:
>>>>Yet another case where warning suppression in system headers hurts the
>>>>library's ability to give diagnostics. We can't warn about using
>>>>incomplete types in std::unique_ptr because the -Wdelete-incomplete
>>>>warning gets suppressed, and the interaction of #pragma GCC diagnostic
>>>>with -Wsystem-headers is ... interesting. We need a way to enable
>>>>warnings for specific blocks of code, to say "do not suppress warnings
>>>>here, even though it's in a system header".
>>>
>>>Can #pragma GCC warning "-Wno-system-headers" do that?
>>
>>I don't think so. It didn't work last time I tried to use that to fix
>>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58876
>>
>>I don't remember the details, but I think there was some weirdness
>>like the "pop" didn't restore the old value, or some other class of
>>warning disappeaed.
>
>
>I might be misremembering. I thought I'd found a problem with that
>approach, but I can't find any evidence of what the problem was.

I was right, push/pop doesn't work for -Wsystem-headers:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70692#c2

My attempted fix for 58876 causes a cascade of other warnings because
-Wsystem-headers remains active (and PR 79078 makes auto_ptr warn
about itself!)

I opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472



More information about the Libstdc++ mailing list