✘Kill all VLAs

Gary E. Miller gem at rellim.com
Tue Oct 30 20:34:59 UTC 2018


Yo Project Manager!

Hal fixed the last two yesterday.

On Tue, 30 Oct 2018 13:32:15 -0700
"Mark Atwood, Project Manager" <mark.atwood at ntpsec.org> wrote:

> Looks straightforward enough. Ian?
> 
> On Mon, Oct 29, 2018 at 12:02 PM Gary E. Miller via devel
> <devel at ntpsec.org> wrote:
> 
> > Yo All!
> >
> > The Linux kernel has now removed all Varible Length Arrays (VLAs).
> >
> > Linux has spoke:
> >
> > "USING VLA'S IS ACTIVELY STUPID! It generates much more code, and
> > much _slower_ code (and more fragile code), than just using a fixed
> > key size would have done."
> >
> > It is easy to find where VLAs are used, just add the -Wvla cflag.
> >
> > # export CGLAG=-Wvla
> >
> > Then build as usual.
> >
> > Looks like git head NTPsec has two VLAs:
> >
> > [180/273] Compiling tests/libntp/ymd2yd.c
> > ../../tests/libntp/macencrypt.c: In function
> > 'TEST_macencrypt_Encrypt_': ../../tests/libntp/macencrypt.c:34:2:
> > warning: ISO C90 forbids array 'packetPtr'
> >  whose size can't be evaluated [-Wvla]
> >   char packetPtr[totalLength];
> >   ^~~~
> > ../../tests/libntp/macencrypt.c: In function
> > 'TEST_macencrypt_CMAC_Encrypt_':
> > ../../tests/libntp/macencrypt.c:70:2: warning: ISO C90 forbids array
> > 'packetPtr' whose size can't be evaluated [-Wvla]
> >   char packetPtr[totalLength];
> >   ^~~~
> >
> > Should be easy to fix.  Anyone want to try?
> >
> >
> > RGDS
> > GARY
> > ---------------------------------------------------------------------------
> > Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR
> > 97703 gem at rellim.com  Tel:+1 541 382 8588 <(541)%20382-8588>
> >
> >             Veritas liberabit vos. -- Quid est veritas?
> >     "If you can’t measure it, you can’t improve it." - Lord Kelvin
> > _______________________________________________
> > devel mailing list
> > devel at ntpsec.org
> > http://lists.ntpsec.org/mailman/listinfo/devel
> >  




RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20181030/5d61ad1f/attachment.bin>


More information about the devel mailing list