0

您好我刚刚更新了 edk2 包并尝试构建一个 BaseTools 模块。

但是它报告了如下错误

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)]);

我正在使用 gcc 11 和 manjaro 系统。我想问一下这是否是一个错误以及如何修复它。非常感谢!!

4

1 回答 1

2

应用此拉取请求,不再出现错误: https ://github.com/tianocore/edk2/pull/2346

或者等待它被合并。

尝试使用 gcc (Debian 11.2.0-12) 11.2.0

于 2021-12-26T17:07:45.130 回答