Re: -Wvla vs dcnpgettext_expr's VLA decl

2011-12-04 Thread Bruno Haible
Jim Meyering wrote: > >> Do we have a guarantee that that array dimension is reasonable? > > > > Yes. While msgctxt and msgid normally rarely exceed 1 KB (because > > That sounds like convention. Is there a guarantee? No, there is no guarantee. It's the programmer's responsibility to pass only s

Re: -Wvla vs dcnpgettext_expr's VLA decl

2011-12-04 Thread Jim Meyering
Simon Josefsson wrote: > Jim Meyering writes: > >> I can live with the status quo, but it would make -Wvla more useful >> not to put such constructs in commonly-included header files. > > FWIW, I find these definitions from gettext.h are rarely needed, so > unless you really need them, considerin

Re: -Wvla vs dcnpgettext_expr's VLA decl

2011-12-04 Thread Simon Josefsson
Jim Meyering writes: > I can live with the status quo, but it would make -Wvla more useful > not to put such constructs in commonly-included header files. FWIW, I find these definitions from gettext.h are rarely needed, so unless you really need them, considering doing something like this: http

Re: -Wvla vs dcnpgettext_expr's VLA decl

2011-12-03 Thread Jim Meyering
Bruno Haible wrote: > Hi Jim, > >> I tried enabling -Wvla for coreutils and found that it provoked hundreds >> of warnings, all due to this: >> >> ../lib/gettext.h:262:3: error: variable length array 'msg_ctxt_id'\ >> is used [-Werror=vla] >> >> That comes from this inline function from ge

Re: -Wvla vs dcnpgettext_expr's VLA decl

2011-12-03 Thread Bruno Haible
Hi Jim, > I tried enabling -Wvla for coreutils and found that it provoked hundreds > of warnings, all due to this: > > ../lib/gettext.h:262:3: error: variable length array 'msg_ctxt_id'\ > is used [-Werror=vla] > > That comes from this inline function from gettext.h: > > static cons

-Wvla vs dcnpgettext_expr's VLA decl

2011-12-03 Thread Jim Meyering
Hi Bruno, This is in the context of manywarnings, so I'll write to bug-gnulib, of course, you're welcome to add bug-gettext, if desired. I tried enabling -Wvla for coreutils and found that it provoked hundreds of warnings, all due to this: ../lib/gettext.h:262:3: error: variable length array