On 07/24/2013 03:24 AM, Gabriel Dos Reis wrote:

Do you envision this to be useful for C++ too?

There are many bits here.  'const' in C++ does not necessary prevent
race conditions with the variable's type has to run non-atomic constructors,
or if the object has data members declared mutable, etc.

I think the warning will mean the same thing for PODs without mutable fields as in C. It's true that a const object is not necessarily physically const (i.e., in .rodata or .data.rel.ro), but I don't think this is a problem.

My main concern here is C, but I think it's useful to have parity between the two front ends if possible.

I think the C++ ABI mandates that the implementation adds implicit locks
to enforce orderly initialization

Yes, that's how we implement it.

--
Florian Weimer / Red Hat Product Security Team

Reply via email to