0

Hi I just updated edk2 package and trying to build a BaseTools module.

But it reported an error like the following

brotli/c/dec/decode.c:2033:41: error:argument 2 of type ‘const uint8_t *’ {或称 ‘const unsigned char *’} declared as a pointer [-Werror=vla-parameter]
 2033 |     size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
      |                          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from brotli/c/dec/decode.c:7:
./brotli/c/include/brotli/decode.h:204:19: 附注:previously declared as a variable length array ‘const uint8_t[*decoded_size]’ {或称 ‘const unsigned char[*decoded_size]’}
  204 |     const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brotli/c/dec/decode.c:2034:14: error:argument 4 of type ‘uint8_t *’ {或称 ‘unsigned char *’} declared as a pointer [-Werror=vla-parameter]
 2034 |     uint8_t* decoded_buffer) {
      |     ~~~~~~~~~^~~~~~~~~~~~~~
In file included from brotli/c/dec/decode.c:7:
./brotli/c/include/brotli/decode.h:206:13: 附注:previously declared as a variable length array ‘uint8_t[encoded_size]’ {或称 ‘unsigned char[encoded_size]’}
  206 |     uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);

I'm using gcc 11 and with manjaro system. I would like to ask if it is a bug and how to fix it. Thanks a lot!!

Shore
  • 827
  • 9
  • 24

1 Answers1

2

Apply this pull request and no more errors: https://github.com/tianocore/edk2/pull/2346

Or wait for it to be merged.

Tried with gcc (Debian 11.2.0-12) 11.2.0

Daniele
  • 31
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 26 '21 at 22:28
  • Sorry for the late replay and thanks a lot!!! I'll try when I got home lol~~ – Shore Dec 27 '21 at 00:22