On 03/01/19 08:22, Bernhard Voelker wrote: > On 12/28/18 8:41 AM, Assaf Gordon wrote: >> pushed here: > > I get these 2 new warnings here on openSUSE:Tumbleweed: > > $ make > ... > CC src/basenc-basenc.o > src/basenc.c: In function 'do_encode': > src/basenc.c:980:8: error: argument to variable-length array may be too > large due to \ > conversion from 'int' to 'long unsigned int' [-Werror=vla-larger-than=] > char outbuf[BASE_LENGTH (ENC_BLOCKSIZE)]; > ^~~~~~ > src/basenc.c: In function 'do_decode': > src/basenc.c:1018:8: error: argument to variable-length array may be too > large due to \ > conversion from 'int' to 'long unsigned int' [-Werror=vla-larger-than=] > char inbuf[BASE_LENGTH (DEC_BLOCKSIZE)]; > ^~~~~ > cc1: all warnings being treated as errors > > $ gcc --version | head -n1 > gcc (SUSE Linux) 8.2.1 20181108 [gcc-8-branch revision 265914] > > Maybe the BASE??_LENGTH macros should do a cast? > > Have a nice day, > Berny >
I wonder should we avoid VLAs in coreutils altogether? I.E. add -Werror=vla. The kernel has done this for security reaons. cheers, Pádraig