coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: baseN: new program suggestion (various 'base' encoding)


From: Pádraig Brady
Subject: Re: baseN: new program suggestion (various 'base' encoding)
Date: Fri, 4 Jan 2019 09:38:14 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]