[PATCH] libgcc: Use inline variable instead of function-local static

Jason Merrill jason@redhat.com
Wed Oct 9 22:55:55 GMT 2024


On 10/8/24 8:58 AM, Michael Matz wrote:
> Hello,
> 
> On Tue, 8 Oct 2024, Jonathan Wakely wrote:
> 
>> We originally had global static variables, which means a different
>> variable per TU. That causes ODR violations which were silently
>> ignored until we try to use them in modules, where they're diagnosed.
>> So we need to replace them.
> 
> Aren't these variables implementation detail?  If so violating language
> rules like ODR should be okay.  (Imagine libgcc would be written in some
> language where such rules doesn't exist).
> 
> So isn't the actual problem that needs solving rather that c++ modules
> trip over these here?

That's an interesting point; we need to handle internal variables in 
header units, I'm not sure how much trouble it would be to provide a way 
to suppress the exposure diagnostic for particular statics in a named 
module.

Jason



More information about the Libstdc++ mailing list