summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-06-30 10:14:21 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-06-30 10:14:21 -0700
commit65ab3ab1976c9e1e2642dd2e79316ff4129d8bc9 (patch)
tree10f77d9be420c338718c0e0ccaf17f7f4d966c56 /config
parentf21b2ba8f3772eb7d1207c214a181516b9d1f4e4 (diff)
downloadnasm-65ab3ab1976c9e1e2642dd2e79316ff4129d8bc9.tar.gz
clang: mark inline functions unused and add warning options
clang, unlike gcc, will warn on inline functions which are unused. This can happen if a function is either intended to be used in the future, or it is only used under certain config options. Mark those functions with the "unused" attribute; not only does it quiet the warning, but it also documents it for the user. Shuffle around the warning options in configure and add a few more that are specific to clang. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'config')
-rw-r--r--config/unconfig.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/config/unconfig.h b/config/unconfig.h
index d01c2b3e..c7d900fc 100644
--- a/config/unconfig.h
+++ b/config/unconfig.h
@@ -60,6 +60,12 @@
/* Define to 1 if compiled with the `-Wc90-c99-compat' compiler flag */
/* #undef CFLAGS_WC90_C99_COMPAT */
+/* Define to 1 if compiled with the `-Wc99-compat' compiler flag */
+/* #undef CFLAGS_WC99_COMPAT */
+
+/* Define to 1 if compiled with the `-Wc99-extensions' compiler flag */
+/* #undef CFLAGS_WC99_EXTENSIONS */
+
/* Define to 1 if compiled with the `-Werror' compiler flag */
/* #undef CFLAGS_WERROR */
@@ -225,6 +231,10 @@
functions */
/* #undef HAVE_FUNC_ATTRIBUTE_SENTINEL */
+/* Define to 1 if your compiler supports __attribute__((unused)) on functions
+ */
+/* #undef HAVE_FUNC_ATTRIBUTE_UNUSED */
+
/* Define to 1 if your compiler supports __attribute__((alloc_size)) on
function pointers */
/* #undef HAVE_FUNC_PTR_ATTRIBUTE1_ALLOC_SIZE */
@@ -265,6 +275,10 @@
pointers */
/* #undef HAVE_FUNC_PTR_ATTRIBUTE_SENTINEL */
+/* Define to 1 if your compiler supports __attribute__((unused)) on function
+ pointers */
+/* #undef HAVE_FUNC_PTR_ATTRIBUTE_UNUSED */
+
/* Define to 1 if you have the `getgid' function. */
/* #undef HAVE_GETGID */
@@ -714,6 +728,22 @@
# endif
#endif
+#ifndef unused_func
+# ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
+# define unused_func __attribute__((unused))
+# else
+# define unused_func
+# endif
+#endif
+
+#ifndef unused_func_ptr
+# ifdef HAVE_FUNC_PTR_ATTRIBUTE_UNUSED
+# define unused_func_ptr __attribute__((unused))
+# else
+# define unused_func_ptr
+# endif
+#endif
+
#ifndef never_null
# ifdef HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
# define never_null __attribute__((returns_nonnull))