]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hexdump: add __attribute__ ((__noreturn__)) to bad*() functions
authorOndrej Oprala <ooprala@redhat.com>
Fri, 8 Nov 2013 16:13:13 +0000 (17:13 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Dec 2013 12:44:24 +0000 (13:44 +0100)
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
text-utils/hexdump-parse.c

index 291c620f90dc5c8b41ec42df19e03da1f4604903..ed94bb8393d06eed855c0736a73b49f4b9808e08 100644 (file)
 #include "strutils.h"
 
 static void escape(char *p1);
-static void badcnt(const char *s);
-static void badsfmt(void);
-static void badfmt(const char *fmt);
-static void badconv(const char *ch);
+
+static void __attribute__ ((__noreturn__)) badcnt(const char *s)
+{
+        errx(EXIT_FAILURE, _("bad byte count for conversion character %s"), s);
+}
+
+static void __attribute__ ((__noreturn__)) badsfmt(void)
+{
+        errx(EXIT_FAILURE, _("%%s requires a precision or a byte count"));
+}
+
+static void __attribute__ ((__noreturn__)) badfmt(const char *fmt)
+{
+        errx(EXIT_FAILURE, _("bad format {%s}"), fmt);
+}
+
+static void __attribute__ ((__noreturn__)) badconv(const char *ch)
+{
+        errx(EXIT_FAILURE, _("bad conversion character %%%s"), ch);
+}
 
 #define first_letter(s,f) strchr(f, *(s))
 
@@ -474,23 +490,3 @@ static void escape(char *p1)
                ++p1; ++p2;
        }
 }
-
-static void badcnt(const char *s)
-{
-        errx(EXIT_FAILURE, _("bad byte count for conversion character %s"), s);
-}
-
-static void badsfmt(void)
-{
-        errx(EXIT_FAILURE, _("%%s requires a precision or a byte count"));
-}
-
-static void badfmt(const char *fmt)
-{
-        errx(EXIT_FAILURE, _("bad format {%s}"), fmt);
-}
-
-static void badconv(const char *ch)
-{
-        errx(EXIT_FAILURE, _("bad conversion character %%%s"), ch);
-}