Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <55312A6E.10507@mailbox.org>
Date: Fri, 17 Apr 2015 17:44:46 +0200
From: Frank Dittrich <frank.dittrich@...lbox.org>
To: john-dev@...ts.openwall.com
Subject: Add __attribute__ ((__noreturn__)) to error() and pexit() in misc.h

Solar,

please consider adding __attribute__ ((__noreturn__)) to error() and
pexit() in misc.h.

This should help the compiler optimizing the code, and it also avoids
false positives in static analysis tools like scan-build.
It would also make magnum's task of merging easier, since I changed
bleeding-jumbo in the following way:

diff --git a/src/misc.h b/src/misc.h
index e5653ee..12e22c8 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -46,7 +46,13 @@
  * Exit on error. Logs the event, closes john.pot and the log file, and
  * terminates the process with non-zero exit status.
  */
-extern void real_error(char *file, int line);
+extern void real_error(char *file, int line)
+#ifdef __GNUC__
+    __attribute__ ((__noreturn__));
+#else
+    ;
+#endif
+
 #define error(...) real_error(__FILE__, __LINE__)
 
 /*
@@ -54,6 +60,7 @@ extern void real_error(char *file, int line);
  */
 extern void real_pexit(char *file, int line, char *format, ...)
 #ifdef __GNUC__
+    __attribute__ ((__noreturn__))
     __attribute__ ((format (printf, 3, 4)));
 #else
     ;


Frank

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.