[parted-devel] [PATCH] RFC: Fix error/warning about noreturn

Phillip Susi psusi at ubuntu.com
Wed Apr 19 18:44:03 UTC 2017


make check issues a warning, which is converted to an error, that
a function is a candidate for using noreturn.  I'm not sure why
autoconf is enabling this warning by default, or why we didn't
used to get this ( maybe the check package added noreturn to it's
fail()? ).  Adding the gcc specific attribute for noreturn allows
make check to succeed, but I don't think it is portable.  Does
anyone know the proper portable way to do this?
---
 libparted/tests/common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libparted/tests/common.c b/libparted/tests/common.c
index 2be0e3a..486fa21 100644
--- a/libparted/tests/common.c
+++ b/libparted/tests/common.c
@@ -24,14 +24,12 @@ size_t get_sector_size (void)
   return ss;
 }
 
-PedExceptionOption
+__attribute((noreturn)) PedExceptionOption
 _test_exception_handler (PedException* e)
 {
         fail ("Exception of type %s has been raised: %s",
               ped_exception_get_type_string (e->type),
               e->message);
-
-        return PED_EXCEPTION_UNHANDLED;
 }
 
 char*
-- 
2.7.4




More information about the parted-devel mailing list