]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: mark some functions as noreturn
authorEric Sandeen <sandeen@sandeen.net>
Thu, 10 Sep 2009 21:17:56 +0000 (16:17 -0500)
committerAlex Elder <aelder@sgi.com>
Thu, 10 Sep 2009 21:17:56 +0000 (16:17 -0500)
Static checkers are a lot less noisy if they know certain
functions are noreturn.

Making this change removed about 50 errors from "clang" output.
(http://clang-analyzer.llvm.org) output.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
mkfs/xfs_mkfs.c
repair/err_protos.h
repair/xfs_repair.c

index 69d91c505f333c7ad573e93a6f9d08216161f183..ab8a7d9e7d020b64e83e8308f8e87cd931c3ccbb 100644 (file)
@@ -27,7 +27,7 @@
  */
 static void conflict(char opt, char *tab[], int oldidx, int newidx);
 static void illegal(char *value, char *opt);
-static void reqval(char opt, char *tab[], int idx);
+static __attribute__((noreturn)) void reqval(char opt, char *tab[], int idx);
 static void respec(char opt, char *tab[], int idx);
 static void unknown(char opt, char *s);
 static int  ispow2(unsigned int i);
@@ -2464,7 +2464,7 @@ ispow2(
        return (i & (i - 1)) == 0;
 }
 
-static void
+static void __attribute__((noreturn))
 reqval(
        char            opt,
        char            *tab[],
index 556e9b94d8bfc9e2e160dae1422247e434f7fe84..6944950a8d48620aa47dcd36034ae61da79682e5 100644 (file)
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-void   do_abort(char const *, ...);            /* abort, internal error */
-void   do_error(char const *, ...);            /* abort, system error */
-void   do_warn(char const *, ...);             /* issue warning */
-void   do_log(char const *, ...);              /* issue log message */
+/* abort, internal error */
+void  __attribute__((noreturn)) do_abort(char const *, ...);
+/* abort, system error */
+void  __attribute__((noreturn)) do_error(char const *, ...);
+/* issue warning */
+void do_warn(char const *, ...);
+/* issue log message */
+void do_log(char const *, ...);
index e9e596511fddfed0a9aba726abd4655c357adcbc..5dfc3c3e237fed761ff7be716045f1e2498dbbce 100644 (file)
@@ -351,7 +351,7 @@ do_msg(int do_abort, char const *msg, va_list args)
        }
 }
 
-void
+void __attribute__((noreturn))
 do_error(char const *msg, ...)
 {
        va_list args;
@@ -366,7 +366,7 @@ do_error(char const *msg, ...)
  * like do_error, only the error is internal, no system
  * error so no oserror processing
  */
-void
+void __attribute__((noreturn))
 do_abort(char const *msg, ...)
 {
        va_list args;