3 ms·
Ah, good point. One more reason for me to hate VLAs. ;) The negative-length array trick is used in the Linux kernel source code [1]. I expect it's compiled w
by Mindless2112 10y ago
Ah, good point. One more reason for me to hate VLAs. ;)
The negative-length array trick is used in the Linux kernel source code [1]. I expect it's compiled with -Wvla though.
[1] https://github.com/torvalds/linux/blob/v4.5/arch/x86/boot/boot.h#L32 https://github.com/torvalds/linux/blob/v4.5/arch/x86/boot/bo...
- Sacho 10y agoLooks exactly like the macro Jan Beulich replaced with the one discussed in OP: https://github.com/torvalds/linux/commit/8c87df457cb58fe75b9b893007917cf8095660a0 https://github.com/torvalds/linux/commit/8c87df457cb58fe75b9...
- pjmlp 10y agoThey are so good that they became optional in C11[0] and thankfully were not adopted by ANSI C++. [0] - ISO 9899:2011 Programming Languages - C 6.7.6.2 4