[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] ✘Kill all VLAs
From: |
Gary E. Miller |
Subject: |
[gpsd-dev] ✘Kill all VLAs |
Date: |
Mon, 29 Oct 2018 12:23:12 -0700 |
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 gpsd has several VLAs. Should be easy to fix.
Anyone want to try?
Here the are:
driver_nmea2000.c: In function 'nmea2000_open':
driver_nmea2000.c:1542:5: warning: ISO C90 forbids variable length array
'interface_name' [-Wvla]
char interface_name[strlen(session->gpsdata.dev.path)+1];
^~~~
libgpsd_core.c: In function 'gpsd_open':
libgpsd_core.c:467:2: warning: ISO C90 forbids variable length array 'server'
[-Wvla]
char server[strlen(session->gpsdata.dev.path)+1], *port;
^~~~
libgpsd_core.c:494:2: warning: ISO C90 forbids variable length array 'server'
[-Wvla]
char server[strlen(session->gpsdata.dev.path)+1], *port;
^~~~
libgpsd_core.c:523:2: warning: ISO C90 forbids variable length array 'server'
[-Wvla]
char server[strlen(session->gpsdata.dev.path)+1], *port;
^~~~
net_ntrip.c: In function 'ntrip_open':
net_ntrip.c:460:5: warning: ISO C90 forbids variable length array 't' [-Wvla]
char t[strlen(caster) + 1];
^~~~
gpsmon.c: In function 'packet_dump':
gpsmon.c:317:2: warning: ISO C90 forbids variable length array 'buf2' [-Wvla]
char buf2[buflen * 2];
^~~~
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
pgpO1UUKmDde1.pgp
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gpsd-dev] ✘Kill all VLAs,
Gary E. Miller <=