On Wed, Oct 18, 2023 at 08:12:37PM +0000, Qing Zhao wrote:
> Marek,
> 
> Sorry for the late comment (I was just back from a long vacation immediate 
> after Cauldron). 

No worries.
 
> One question:
> 
> Is the option “-fhandened” for production build or for development build? 

I intend -fhardened to be for production builds.

> If it’s for development build, then adding -ftrivial-auto-var-init=pattern is 
> reasonable since the major purpose for  -ftrivial-auto-var-init=pattern is 
> for debugging, the runtime overhead of -ftrivial-auto-var-init=pattern is 
> higher then -ftrivial-auto-var-init=zero.
> 
> However, if it’s for production build, then adding 
> -ftrivial-auto-var-init=zero is better since the major purpose for 
> -ftrivial-auto-var-init=zero is for production build to eliminate all 
> uninitialization. And the runtime overhead of =zero is smaller than =pattern.

Okay, I've changed the patch back to enabling -ftrivial-auto-var-init=zero.

In future C++ modes, we may have to default to -ftrivial-auto-var-init=zero
as per <http://wg21.link/P2723> anyway.  On the other hand, it seems that
<https://wg21.link/p2795r3> might change that again...

Marek

Reply via email to