Skip to contentSkip to conversation

Variable-length arrays considered bad

DISCUSSION Kalle Valo 2 participants 3 messages Mar 8, 2018 – Mar 9, 2018

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

Hi,

in an lkml discussion[1] it was mentioned that variable-length arrays should not be used. Few warnings were found[2] from wireless:

drivers/net/wireless/ath/ath9k/dfs.c:104:2: warning: ISO C90 forbids variable length array 'max_bin' [-Wvla] drivers/net/wireless/rsi/rsi_91x_sdio.c:570:2: warning: ISO C90 forbids variable length array 'temp_buf' [-Wvla]

Patches welcome.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

[2] http://paste.ubuntu.com/p/srQxwPQS9s/

Signature · 1 line
Kalle Valo
#1 lore raw
Quoted 5 lines · Kalle Valo

Hi,

in an lkml discussion[1] it was mentioned that variable-length arrays should not be used. Few warnings were found[2] from wireless:

Quoted 9 lines

drivers/net/wireless/ath/ath9k/dfs.c:104:2: warning: ISO C90 forbids variable length array 'max_bin' [-Wvla] drivers/net/wireless/rsi/rsi_91x_sdio.c:570:2: warning: ISO C90 forbids variable length array 'temp_buf' [-Wvla]

Patches welcome.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

[2] http://paste.ubuntu.com/p/srQxwPQS9s/

I will submit a cleanup patch for RSI warning

Regards,
Amitkumar Karwar

author
#2 lore raw
Quoted 13 lines · Amitkumar Karwar
Quoted 12 lines · Kalle Valo

Hi,

in an lkml discussion[1] it was mentioned that variable-length arrays should not be used. Few warnings were found[2] from wireless:

drivers/net/wireless/ath/ath9k/dfs.c:104:2: warning: ISO C90 forbids variable length array 'max_bin' [-Wvla] drivers/net/wireless/rsi/rsi_91x_sdio.c:570:2: warning: ISO C90 forbids variable length array 'temp_buf' [-Wvla]

Patches welcome.

Quoted 7 lines
Quoted 5 lines

[1]
https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

[2] http://paste.ubuntu.com/p/srQxwPQS9s/

I will submit a cleanup patch for RSI warning

Thanks, but Tobin was faster:

https://lkml.kernel.org/r/[email protected]

He just forgot to CC linux-wireless.

Signature · 1 line
Kalle Valo