[nasm:nasm-2.15.xx] configure.ac: add option to compile with suggestion warnings
nasm-bot for H. Peter Anvin (Intel)
hpa at zytor.com
Thu Jul 30 17:39:03 PDT 2020
Commit-ID: 50200cc0d3d9847d40c5ed3ff87c47c1bde5d6dc
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=50200cc0d3d9847d40c5ed3ff87c47c1bde5d6dc
Author: H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Thu, 30 Jul 2020 17:37:42 -0700
Committer: H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Thu, 30 Jul 2020 17:37:42 -0700
configure.ac: add option to compile with suggestion warnings
Add a configure option to enable suggestion warnings, currently a set
of -Wsuggest-attribute=* warnings.
Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>
---
configure.ac | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/configure.ac b/configure.ac
index 7b727693..17132af9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -396,6 +396,18 @@ PA_ARG_ENABLED([werror],
PA_ADD_CFLAGS([-Werror=vla])]
)
+dnl Warnings that are probabilistic based on the compiler version, and
+dnl only should be used specifically when looking for opportunities to
+dnl address or optimize these cases.
+PA_ARG_ENABLED([suggestions],
+ [compile with compiler suggestion warnings enabled],
+ [PA_ADD_CFLAGS([-Wsuggest-attribute=pure])
+ PA_ADD_CFLAGS([-Wsuggest-attribute=const])
+ PA_ADD_CFLAGS([-Wsuggest-attribute=noreturn])
+ PA_ADD_CFLAGS([-Wsuggest-attribute=format])
+ PA_ADD_CFLAGS([-Wsuggest-attribute=cold])
+ PA_ADD_CFLAGS([-Wsuggest-attribute=malloc])])
+
dnl
dnl Test compiler features. On some compilers, this can be affected
dnl by -Werror options, so run this *after* those options are added.
More information about the Nasm-commits
mailing list