Re: ✘Kill all VLAs

Mark Atwood, Project Manager mark.atwood at ntpsec.org
Tue Oct 30 20:32:15 UTC 2018


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
>
-- 

Mark Atwood
http://about.me/markatwood
+1-206-604-2198
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20181030/22f19b5b/attachment.html>


More information about the devel mailing list