Greetings!

I'm happy to see discussion (including opposing/disagreeing opinions
!) on my proposal.

Wanted to cover one of the side-item in separate email - specifically
keeping -Wvla-larger-than not impacted by the proposed  [[gnu::vla]]

In my projects, we use -Wvla and -Wvla-larger-than=512000 (~1MB, given
each of our threads is configured for 5MB thread. This is the same
setting we for frame-larger-than.

 Common scenario we have is:

// In header.h
#define MAX_POINTS 25000

// In code
int foo(void)
{
     int n = MAX_POINTS ;
     ALLOW_VLA(int v[n+1] ) ;     // ALLOW_VLA uses Pragma to ignore -Wvla
}

The "ALLOW_VLA" indicate that the usage was reviewed - and approved.
Common issue that we have is that the header.h is modified -> #define
MAX_POINTS 250000. The compiler does not warn on the VLA use - because
we tagged it safe. Keeping -Wvla-larger-than=500KB allow us to be
notified when of places where VLA usage is valid, but exceeds the
threshold.

Hope this use case is clean - and explain why I believe
-Wvla-larger-than should NOT be impacted with the proposed [[gnu::lva]

Regards,
Yair

Reply via email to