summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2015-08-04 13:40:44 +0200
committerKarel Zak2015-08-04 13:40:44 +0200
commit2c6567799debe6017b1a1e1f5695fbe632545521 (patch)
tree1bfe40ffa880df25d50d5ae9102634bde87bda3b
parentlibmount: cleanup assert() usage (diff)
downloadkernel-qcow2-util-linux-2c6567799debe6017b1a1e1f5695fbe632545521.tar.gz
kernel-qcow2-util-linux-2c6567799debe6017b1a1e1f5695fbe632545521.tar.xz
kernel-qcow2-util-linux-2c6567799debe6017b1a1e1f5695fbe632545521.zip
build-sys: add --disable-assert
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--Documentation/releases/v2.27-ReleaseNotes2
-rw-r--r--configure.ac1
-rw-r--r--include/c.h2
-rw-r--r--libfdisk/src/fdiskP.h8
-rw-r--r--libfdisk/src/version.c2
-rw-r--r--libmount/src/mountP.h9
-rw-r--r--libmount/src/version.c4
-rw-r--r--libsmartcols/src/smartcolsP.h9
8 files changed, 8 insertions, 29 deletions
diff --git a/Documentation/releases/v2.27-ReleaseNotes b/Documentation/releases/v2.27-ReleaseNotes
index 21de1112f..44793220c 100644
--- a/Documentation/releases/v2.27-ReleaseNotes
+++ b/Documentation/releases/v2.27-ReleaseNotes
@@ -50,6 +50,8 @@ The command rtcwake supports a new option --list-modes to list available modes,
and a new option --date for human-readable times. rtcwake does not support
RTC_ALM_READ and RTC_ALM_SET fallbacks any more.
+The util-linux code is possible rebuild with --disable-assert now.
+
Stable maintenance releases between v2.26 and v2.27
---------------------------------------------------
diff --git a/configure.ac b/configure.ac
index cd2ef86c0..6dc7f05b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,6 +169,7 @@ UL_SET_ARCH([MIPS], [mips*])
UL_SET_ARCH([HPPA], [hppa*])
AC_SYS_LARGEFILE
+AC_HEADER_ASSERT
dnl Don't forget to maintain alternatively allowed versions in autogen.sh!
AM_GNU_GETTEXT_VERSION([0.18.3])
diff --git a/include/c.h b/include/c.h
index 1eda75f6b..2a317eb52 100644
--- a/include/c.h
+++ b/include/c.h
@@ -15,6 +15,8 @@
#include <string.h>
#include <errno.h>
+#include <assert.h>
+
#ifdef HAVE_ERR_H
# include <err.h>
#endif
diff --git a/libfdisk/src/fdiskP.h b/libfdisk/src/fdiskP.h
index 10380e15b..2961095c9 100644
--- a/libfdisk/src/fdiskP.h
+++ b/libfdisk/src/fdiskP.h
@@ -17,7 +17,6 @@
#include <sys/types.h>
#include <unistd.h>
-
#include "c.h"
#include "libfdisk.h"
@@ -27,13 +26,6 @@
#include <stdio.h>
#include <stdarg.h>
-/* features */
-#define CONFIG_LIBFDISK_ASSERT
-
-#ifdef CONFIG_LIBFDISK_ASSERT
-#include <assert.h>
-#endif
-
/*
* Debug
*/
diff --git a/libfdisk/src/version.c b/libfdisk/src/version.c
index db8467b51..bfbd7c5e3 100644
--- a/libfdisk/src/version.c
+++ b/libfdisk/src/version.c
@@ -17,7 +17,7 @@
static const char *lib_version = LIBFDISK_VERSION;
static const char *lib_features[] = {
-#ifdef CONFIG_LIBFDISK_ASSERT
+#if !defined(NDEBUG) /* libc assert.h stuff */
"assert",
#endif
"debug", /* always enabled */
diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h
index d28eb9cdd..660e0ad08 100644
--- a/libmount/src/mountP.h
+++ b/libmount/src/mountP.h
@@ -25,15 +25,6 @@
#include "debug.h"
#include "libmount.h"
-/* features */
-#define CONFIG_LIBMOUNT_ASSERT
-
-#ifdef CONFIG_LIBMOUNT_ASSERT
-# include <assert.h>
-#else
-# define assert(x)
-#endif
-
/*
* Debug
*/
diff --git a/libmount/src/version.c b/libmount/src/version.c
index 28f3a574b..d81d4323f 100644
--- a/libmount/src/version.c
+++ b/libmount/src/version.c
@@ -25,8 +25,8 @@ static const char *lib_features[] = {
#ifdef HAVE_SMACK
"smack",
#endif
-#ifdef CONFIG_LIBMOUNT_ASSERT
- "assert",
+#if !defined(NDEBUG)
+ "assert", /* libc assert.h stuff */
#endif
"debug", /* always enabled */
NULL
diff --git a/libsmartcols/src/smartcolsP.h b/libsmartcols/src/smartcolsP.h
index 95c00db8f..2cf8a9d6d 100644
--- a/libsmartcols/src/smartcolsP.h
+++ b/libsmartcols/src/smartcolsP.h
@@ -18,15 +18,6 @@
#include "libsmartcols.h"
-/* features */
-#define CONFIG_LIBSMARTCOLS_ASSERT
-
-#ifdef CONFIG_LIBSMARTCOLS_ASSERT
-# include <assert.h>
-#else
-# define assert(x)
-#endif
-
/*
* Debug
*/