我之前在 gcc 6.4.0 中使用 msys2 并且正在为我的项目工作。我将工具链和 gcc 升级到 9.1.0。现在我收到此错误:
一小部分代码:
memset(payload, 0, 8192);
sprintf(payload, "GET %s%s HTTP/1.1\r\n", dynamic_fota_url,
new_firmware_version);
sprintf(payload, "%sHost: %s\r\n", payload, dynamic_hostname);
sprintf(payload, "%sPort: 443\r\n", payload);
sprintf(payload, "%sAccept: */*\r\n\r\n", payload);
错误信息是:-
D:/dozee/dozee_compiler/msys32/home/esp-idf/examples/dozee_fw_v62/main/dozee_next.c:2092:12: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
sprintf(payload, "%sPort: 443\r\n", payload);
^~~~~~~ ~~~~~~~
D:/dozee/dozee_compiler/msys32/home/esp-idf/examples/dozee_fw_v62/main/dozee_next.c:2093:12: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
sprintf(payload, "%sAccept: */*\r\n\r\n", payload);
^~~~~~~ ~~~~~~~
D:/dozee/dozee_compiler/msys32/home/esp-idf/examples/dozee_fw_v62/main/dozee_next.c:2344:15: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
sprintf(payload, "%sHost: %s\r\n", payload, dynamic_hostname);
^~~~~~~ ~~~~~~~
D:/dozee/dozee_compiler/msys32/home/esp-idf/examples/dozee_fw_v62/main/dozee_next.c:2345:15: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
sprintf(payload, "%sPort: 443\r\n", payload);
我怎样才能解决这个问题。如何将我的 gcc 降级到以前的版本?