bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] openat-die: use _Noreturn markup


From: Eric Blake
Subject: [PATCH v2] openat-die: use _Noreturn markup
Date: Thu, 31 Jul 2014 10:43:16 -0600

Compiling coreutils.git on cygwin with gcc 4.8.3, I got:

lib/openat-die.c:34:1: error: function might be candidate for attribute 
'noreturn' [-Werror=suggest-attribute=noreturn]
 openat_save_fail (int errnum)
 ^

* modules/openat-die (Depends-on): Add snippet/_Noreturn.
* lib/openat-die.c (openat_save_fail, openat_restore_fail): Mark
_Noreturn.

Signed-off-by: Eric Blake <address@hidden>
---

This is the version I'm pushing.

 ChangeLog          | 7 +++++++
 lib/openat-die.c   | 4 ++--
 modules/openat-die | 1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f4d9022..1fbf438 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-31  Eric Blake  <address@hidden>
+
+       openat-die: use _Noreturn markup
+       * modules/openat-die (Depends-on): Add snippet/_Noreturn.
+       * lib/openat-die.c (openat_save_fail, openat_restore_fail): Mark
+       _Noreturn.
+
 2014-07-30  Eric Blake  <address@hidden>

        test-open: port to cygwin, which lacks Fortify
diff --git a/lib/openat-die.c b/lib/openat-die.c
index 02f1fd7..80c0929 100644
--- a/lib/openat-die.c
+++ b/lib/openat-die.c
@@ -30,7 +30,7 @@
 #include "gettext.h"
 #define _(msgid) gettext (msgid)

-void
+void _Noreturn
 openat_save_fail (int errnum)
 {
 #ifndef GNULIB_LIBPOSIX
@@ -49,7 +49,7 @@ openat_save_fail (int errnum)
    during an openat emulation.  The caller must ensure that fd 2 is
    not a just-opened fd, even when openat_safer is not in use.  */

-void
+void _Noreturn
 openat_restore_fail (int errnum)
 {
 #ifndef GNULIB_LIBPOSIX
diff --git a/modules/openat-die b/modules/openat-die
index 08bef77..c5f9af2 100644
--- a/modules/openat-die
+++ b/modules/openat-die
@@ -9,6 +9,7 @@ openat-h
 error
 exitfail
 gettext-h
+snippet/_Noreturn

 configure.ac:

-- 
1.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]