]> xenbits.xensource.com Git - unikraft/libs/libcxx.git/commitdiff
Assign `-Wno-keyword-compat` to clang only
authorSimon Kuenzer <simon@unikraft.io>
Thu, 31 Aug 2023 09:22:34 +0000 (11:22 +0200)
committerUnikraft <monkey@unikraft.io>
Thu, 31 Aug 2023 13:59:04 +0000 (13:59 +0000)
The compiler flag `-Wno-keyword-compat` is not recognized by GCC, but by
clang. Although it does not harm the resulting compilation unit (GCC has a
special handling of `-Wno-*` flags), an additional warning message is issued if
a compilation unit fails or produces other warnings:

```
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-keyword-compat' may have been intended to silence earlier diagnostics
```

This commit assigns `-Wno-keyword-compat` to clang only.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #35

Makefile.uk

index 9a3f1c9b8972fbbeda4dbdcfb65482582576481e..9261779174d454df065cf3caff7afe7b9e3eb00f 100644 (file)
@@ -97,7 +97,7 @@ LIBCXX_SUPPRESS_FLAGS-y += -Wno-parentheses
 LIBCXX_SUPPRESS_FLAGS-y += -Wno-deprecated-declarations
 LIBCXX_SUPPRESS_FLAGS-y += -Wno-array-bounds
 LIBCXX_SUPPRESS_FLAGS-y += -Wno-cpp
-LIBCXX_SUPPRESS_FLAGS-y += -Wno-keyword-compat
+LIBCXX_SUPPRESS_FLAGS-$(call have_clang) += -Wno-keyword-compat
 LIBCXX_SUPPRESS_FLAGS-$(call have_clang) += -Wno-user-defined-literals
 LIBCXX_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-stringop-overflow
 LIBCXX_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-alloc-size-larger-than