Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: toolchain@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH v2] profiles/base: add cache vars for -Wimplicit-function-declaration silencing
Date: Tue, 28 Feb 2023 19:04:08
Message-Id: 20230228190359.1316958-1-sam@gentoo.org
1 Autoconf has a builtin check to try figure out how to make the compiler
2 error out on implicit function declarations. This check necessarily emits
3 such a warning/error. We know that -Werror=implicit-function-declaration
4 will work on any compiler we care about, so just force that to avoid noise.
5
6 This means we don't have to try whitelist 'strchr'.
7
8 v2: drop 'export' as PMS doesn't allow it in make.defaults.
9
10 Signed-off-by: Sam James <sam@g.o>
11 ---
12 profiles/base/make.defaults | 6 ++++++
13 1 file changed, 6 insertions(+)
14
15 diff --git a/profiles/base/make.defaults b/profiles/base/make.defaults
16 index ab69dbfae58ee..68ff36a90cc8d 100644
17 --- a/profiles/base/make.defaults
18 +++ b/profiles/base/make.defaults
19 @@ -181,3 +181,9 @@ ADA_TARGET="gnat_2021"
20 # Default targets for lua{,-single}.eclass
21 LUA_SINGLE_TARGET="lua5-1"
22 LUA_TARGETS="lua5-1"
23 +
24 +# Sam James <sam@g.o> (2023-02-28)
25 +# Reduce -Wimplicit-function-declaration noise from autoconf. Any compilers
26 +# we care about should match these anyway. See https://wiki.gentoo.org/wiki/Modern_C_porting.
27 +ac_cv_c_undeclared_builtin_options="none needed"
28 +gl_cv_compiler_check_decl_option="-Werror=implicit-function-declaration"
29 --
30 2.39.2

Replies