On Sat, Jun 06, 2020 at 11:25:19 +0200, Kamil Rytarowski wrote: > On 06.06.2020 09:42, Simon Burge wrote: > > "Kamil Rytarowski" wrote: > > > >> Module Name: src > >> Committed By: kamil > >> Date: Fri Jun 5 21:48:04 UTC 2020 > >> > >> Modified Files: > >> > >> src/sys/arch/x86/x86: cpu_rng.c > >> > >> Log Message: > >> > >> Change const unsigned to preprocessor define > >> > >> Fixes GCC -O0 build with the stack protector. > > > > Surely a gcc bug? This almost certainly needs an > > /* XXX gcc stack protector -O0 bug */ comment and > > possibly an entry in doc/HACKS as well otherwise > > someone will come along later and de-uglify this > > change. > > This is not really a GCC bug, as C const is not constexpr. It's > also not the only place with such logic and such workaround. C++ > fixed it and have real const.
Doesn't -Wvla help catching these? Should we enable it? -uwe