Skip to content

Commit

Permalink
config/opal_check_os_flavors.m4: fix -Wimplicit-int in OPAL_CHECK_OS_…
Browse files Browse the repository at this point in the history
…FLAVOR_SPECIFIC

Clang 16 makes -Wimplicit-int an error by default.

This one is harmless but it's very noisy, especially because it's used
a bunch in subconfigures. These warnings becoming errors can, especially in configure,
lead to miscompiled or misconfigured software, so distributions are starting
to look for instances of them in config.log, etc.

In this case, an error is supposed to fire (because it's checking platform
name) but it's easier to use something else so we don't trigger a -Wimplicit-int warning/error instead.

Fixes errors like:
```
error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Werror,-Wimplicit-int]
```

For more information, see LWN.net [0] or LLVM's Discourse [1], Gentoo's wiki [2]
or the (new) c-std-porting mailing list [3].

[0] https://lwn.net/Articles/913505/
[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
[2] https://wiki.gentoo.org/wiki/Modern_C_porting
[3] hosted at lists.linux.dev.

Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam committed Nov 16, 2022
1 parent c74b711 commit 4ce701b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/opal_check_os_flavors.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AC_DEFUN([OPAL_CHECK_OS_FLAVOR_SPECIFIC],
AC_MSG_CHECKING([$1])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#ifndef $1
error: this is not $1
#this is not $1, error
#endif
]])],
[opal_found_$2=yes],
Expand Down

0 comments on commit 4ce701b

Please sign in to comment.