Re: [C, C++] Implement -Wstatic-local

2013-07-24 Thread Florian Weimer
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,

Re: [C, C++] Implement -Wstatic-local

2013-07-23 Thread Gabriel Dos Reis
On Tue, Jul 23, 2013 at 3:02 PM, Florian Weimer wrote: > On 07/23/2013 09:51 PM, Andrew Pinski wrote: >> >> On Tue, Jul 23, 2013 at 12:48 PM, Florian Weimer >> wrote: >>> >>> We sometimes deal with code bases which use static local variables to cut >>> down frame size, for compatibility with lega

Re: [C, C++] Implement -Wstatic-local

2013-07-23 Thread Florian Weimer
On 07/23/2013 09:51 PM, Andrew Pinski wrote: On Tue, Jul 23, 2013 at 12:48 PM, Florian Weimer wrote: We sometimes deal with code bases which use static local variables to cut down frame size, for compatibility with legacy targets. Obviously, this is bad for thread safety. This new warning can

Re: [C, C++] Implement -Wstatic-local

2013-07-23 Thread Andrew Pinski
On Tue, Jul 23, 2013 at 12:48 PM, Florian Weimer wrote: > We sometimes deal with code bases which use static local variables to cut > down frame size, for compatibility with legacy targets. Obviously, this is > bad for thread safety. This new warning can be used to track down such > cases once y

[C, C++] Implement -Wstatic-local

2013-07-23 Thread Florian Weimer
We sometimes deal with code bases which use static local variables to cut down frame size, for compatibility with legacy targets. Obviously, this is bad for thread safety. This new warning can be used to track down such cases once you suspect they exist. Bootstrapped and regression-tested on