openwrt/toolchain/gcc
Andrey Erokhin de2162d27d
toolchain: gcc: backport v11.3.0 fix for false positive VLA params warnings
If the vla parameter has a const specifier, the compiler will warn about
mismatched bounds:

 $ cat mwe.c
 extern void mwe(const int len, char buf[len]);
 void mwe(const int len, char buf[len]) {}

 $ make CFLAGS=-Wvla-parameter mwe.o
 cc -Wvla-parameter   -c -o mwe.o mwe.c
 mwe.c:2:30: warning: argument 2 of type ‘char[len]’ declared with mismatched bound ‘len’ [-Wvla-parameter]
     2 | void mwe(const int len, char buf[len]) {}
       |                         ~~~~~^~~~~~~~
 mwe.c:1:37: note: previously declared as ‘char[len]’ with bound ‘len’
     1 | extern void mwe(const int len, char buf[len]);
       |                                ~~~~~^~~~~~~~

On some code bases it might result in a lot of false positive warnings,
which can indeed be easily disabled, but on the other this workaround
might hide some real issues, so lets rather fix the compiler and make it
more reliable.

References: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101289
Signed-off-by: Andrey Erokhin <a.erokhin@inango-systems.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit message]
2023-11-02 18:45:50 +01:00
..
files do not use the wrapper scripts for exportable toolchains internally. on some systems the wrapper scripts are broken, and their use should be opt-in 2009-11-19 17:23:31 +00:00
final toolchain: gcc: enable sanitizers for glibc toolchain 2019-10-24 11:40:00 +00:00
initial toolchain/gcc: parallelize make install 2017-02-09 14:49:34 +01:00
minimal toolchain: skip gcc/minimal for musl 2016-07-07 15:13:40 +02:00
patches toolchain: gcc: backport v11.3.0 fix for false positive VLA params warnings 2023-11-02 18:45:50 +01:00
Config.in toolchain/gcc: switch to version 11 by default 2021-09-21 22:07:36 -10:00
Config.version toolchain/gcc: switch to version 11 by default 2021-09-21 22:07:36 -10:00
common.mk toolchain: assign PKG_CPE_ID 2023-09-27 17:31:53 +02:00
exclude-testsuite toolchain: add gcc 7.1.0 support 2017-05-25 19:01:07 +02:00