Bug 1183713

Summary: GCC 11: ovmf build fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Liška <martin.liska>
Component: BasesystemAssignee: Gary Ching-Pang Lin <glin>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1181859    

Description Martin Liška 2021-03-18 14:00:57 UTC
Fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/ovmf/standard/x86_64

with:
[   29s] brotli/c/dec/decode.c:2033:41: error: argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} declared as a pointer [-Werror=vla-parameter]
[   29s]  2033 |     size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
[   29s]       |                          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
[   29s] In file included from brotli/c/dec/decode.c:7:
[   29s] ./brotli/c/include/brotli/decode.h:204:19: note: previously declared as a variable length array 'const uint8_t[*decoded_size]' {aka 'const unsigned char[*decoded_size]'}
[   29s]   204 |     const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
[   29s]       |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   29s] brotli/c/dec/decode.c:2034:14: error: argument 4 of type 'uint8_t *' {aka 'unsigned char *'} declared as a pointer [-Werror=vla-parameter]
[   29s]  2034 |     uint8_t* decoded_buffer) {
[   29s]       |     ~~~~~~~~~^~~~~~~~~~~~~~
[   29s] In file included from brotli/c/dec/decode.c:7:
[   29s] ./brotli/c/include/brotli/decode.h:206:13: note: previously declared as a variable length array 'uint8_t[encoded_size]' {aka 'unsigned char[encoded_size]'}
[   29s]   206 |     uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
[   29s]       |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 1 Martin Liška 2021-03-26 09:58:18 UTC
May I please ping this as GCC 11 release is approaching?
Comment 2 Gary Ching-Pang Lin 2021-03-26 12:10:50 UTC
Sorry for the delay.

So gcc11 now requires "uint8_t* encoded_buffer" declared as "uint8_t encoded_buffer[encoded_size]"?
Comment 3 Martin Liška 2021-03-26 12:19:55 UTC
(In reply to Gary Ching-Pang Lin from comment #2)
> Sorry for the delay.
> 
> So gcc11 now requires "uint8_t* encoded_buffer" declared as "uint8_t
> encoded_buffer[encoded_size]"?

Yes please.
Comment 4 Gary Ching-Pang Lin 2021-03-26 14:18:14 UTC
(In reply to Martin Liška from comment #3)
> (In reply to Gary Ching-Pang Lin from comment #2)
> > Sorry for the delay.
> > 
> > So gcc11 now requires "uint8_t* encoded_buffer" declared as "uint8_t
> > encoded_buffer[encoded_size]"?
> 
> Yes please.

Ok. Fix submitted: sr#881515
Comment 5 Martin Liška 2021-03-26 14:43:16 UTC
Thanks, fixed in devel project now.