summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-03-26 08:22:50 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2020-03-26 08:23:59 +0000
commit9c5a9175843ce79427b04a5f23927a415d78d057 (patch)
tree4fc5cf1150aab389f1b3a199965211cdf60d4b10 /eclass/flag-o-matic.eclass
parentsys-kernel/linux-headers: amd64 stable wrt bug #706042 (diff)
downloadgentoo-9c5a9175843ce79427b04a5f23927a415d78d057.tar.gz
gentoo-9c5a9175843ce79427b04a5f23927a415d78d057.tar.bz2
gentoo-9c5a9175843ce79427b04a5f23927a415d78d057.zip
flag-o-matic.eclass: document assumptions and limitations of test-flag-PROG()
Bug: https://bugs.gentoo.org/712488 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 9ef9ac3685e0..e76eef293e89 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -487,6 +487,17 @@ test-flag-PROG() {
printf "%s\n" "${in_src}" > "${test_in}" || die "Failed to create '${test_in}'"
+ # Currently we rely on warning-free output of a compiler
+ # before the flag to see if a flag prduces any warnings.
+ # This has a few drawbacks:
+ # - if compiler already generates warnings we filter out
+ # every single flag: bug #712488
+ # - if user actually wants to see warnings we just strip
+ # them regardless of warnings type.
+ #
+ # We can add more selective detection of no-op flags via
+ # '-Werror=ignored-optimization-argument' and similar error options
+ # similar to what we are doing with '-Qunused-arguments'.
local cmdline=(
"${comp[@]}"
# Clang will warn about unknown gcc flags but exit 0.