* Yair Lenga via Gcc:

> Hi Martin,
>
> Yes - I believe something more "lightweight" than #pragma is needed.
> What I've observed is that it's very "cumbersome", to write
>
> #pragma GCC diagnostic push
> #pragma GCC diagnostic ignored "-Wvla"
>      double a[len] ;
> #pragma GCC diagnostic push
>
> Technically, can be "compacted" via #define - but then it's becoming
> something that it's not "C" any more: e .g.
> int foo(int how_many) {
>     DECLARE_VLA(ddd, double, how_many) ;      // Compact but NOT C
>     int x = 5 ;
> }

Could you achieve this effect if you used _Pragma?  It can be part of
macros.  The quoting is a bit tricky to get right, though.  In your
case, that should be less of an issue because the pragma contents is not
dependent on macro arguments.

Thanks,
Florian

Reply via email to