ToT glibc build problem with ToT GCC

Szabolcs Nagy Szabolcs.Nagy@arm.com
Fri Aug 30 14:14:00 GMT 2019


On 30/08/2019 14:06, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>> Is there a viable solution for a static allocation of a structure
>> that ends in a VLA?
> 
> Sure, use an initializer.  Not sure if this breaks anything.  The test
> suite is clean.
> 
> (GNU C obviously didn't support that when the code was written.)

i didn't know an initializer would be enough.

>  
> -	replace[0].nbytes = 1;
> -	replace[0].bytes[0] = '?';
> -	replace[0].bytes[1] = '\0';
> -	ctype->mboutdigits[cnt] = &replace[0];
> +	static const struct charseq replace =
> +	  {
> +	     .nbytes = 1,
> +	     .bytes = { '\0' },
> +	  };
> +	ctype->mboutdigits[cnt] = (struct charseq *) &replace;
>        }

is it ok to change {'?','\0'} to {'\0'} ?


More information about the Libc-alpha mailing list