[parted-devel] [PATCH 1/2] Fix make check

Phillip Susi psusi at ubuntu.com
Fri May 4 15:38:16 BST 2018


Make check failed due to some warnings treated as errors.  One was
caused by a warning that a function could have the noreturn attribute.
It seems that this had previously been disabled but gcc has changed
the flag from -Wmissing-noreturn to -Wsuggest-attribute=noreturn.  The
recently added volser.c test also caused a few warnings when not
compiled on s390x because most of the functions were no used, so
---
 configure.ac             | 2 +-
 libparted/tests/volser.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 738c697..056478f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,7 +226,7 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wpacked"
   nw="$nw -Wmissing-prototypes"
   nw="$nw -Wmissing-declarations"
-  nw="$nw -Wmissing-noreturn"
+  nw="$nw -Wsuggest-attribute=noreturn"
   # things I might fix soon:
   nw="$nw -Wfloat-equal"            # sort.c, seq.c
   nw="$nw -Wmissing-format-attribute" # copy.c
diff --git a/libparted/tests/volser.c b/libparted/tests/volser.c
index 9063821..c6efa5f 100644
--- a/libparted/tests/volser.c
+++ b/libparted/tests/volser.c
@@ -14,6 +14,8 @@
 #include "common.h"
 #include "progname.h"
 
+#if defined __s390__ || defined __s390x__
+
 /* set dasd first */
 static char vol_devno[7] = {0};
 static char *tmp_disk;
@@ -75,7 +77,6 @@ END_TEST
 
 START_TEST (test_check_volser)
 {
-        char vol[7] = {0};
         char vol_long[] = "abcdefg";
         char vol_short[] = "ab_c   ";
         char vol_null[] = "      ";
@@ -135,6 +136,8 @@ START_TEST (test_reuse_vtoc)
 }
 END_TEST
 
+#endif
+
 int main (int argc, char **argv)
 {
 
-- 
2.7.4




More information about the parted-devel mailing list