[SLOF] [PATCH] lib/libnet/ipv6: Silence compiler warning from Clang

Thomas Huth thuth at redhat.com
Tue Jun 28 16:34:27 AEST 2022


On 28/06/2022 00.05, Segher Boessenkool wrote:
> On Mon, Jun 27, 2022 at 10:26:32AM +0200, Thomas Huth wrote:
>> When compiling the libnet code with Clang (e.g. for the s390-ccw bios),
>> it complains with the following warning:
>>
>>   ipv6.c:447:18: warning: variable length array folded to constant array
>>    as an extension [-Wgnu-folding-constant]
>>                  unsigned short raw[ip6size];
>>                                 ^
>> The warning is completely harmless, of course. Anyway let's rewrite the
>> code a little bit to make the compiler silent again.
> 
> This makes the code worse though :-(
> 
> You could shut off the silly warning instead?  Clang claims to be
> compatible to GCC, and GCC explicitly allows variable-length auto
> arrays even in C90 mode.  This is documented, too.

Ok, can do, SLOF itself cannot be compiled with Clang anyway, so it likely 
makes more sense indeed to disable this warning in the s390-ccw bios that 
uses SLOF's libnet.

  Thomas



More information about the SLOF mailing list