]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: pacify gcc -flto -Wmaybe-uninitialized
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Jan 2022 18:21:48 +0000 (10:21 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Jan 2022 20:07:39 +0000 (12:07 -0800)
* gl/lib/xdectoint.c (__xnumtoint): Tell gcc that ‘error’
does not return here.
* gl/modules/xdectoint (Depends-on): Add stdbool, verify.

gl/lib/xdectoint.c
gl/modules/xdectoint

index 67ec972a1586977147ce64319a1da6d324e6f4be..da53018c08811bb91e5435fbcb93f09ea8fa0503 100644 (file)
 
 #include <errno.h>
 #include <inttypes.h>
+#include <stdbool.h>
 #include <stdlib.h>
 
 #include "error.h"
 #include "quote.h"
+#include "verify.h"
 #include "xstrtol.h"
 
 /* Parse numeric string N_STR of base BASE, and return the value.
@@ -68,6 +70,7 @@ __xnumtoint (char const *n_str, int base, __xdectoint_t min, __xdectoint_t max,
       /* EINVAL error message is redundant in this context.  */
       error (err_exit ? err_exit : EXIT_FAILURE, errno == EINVAL ? 0 : errno,
              "%s: %s", err, quote (n_str));
+      assume (false);
     }
 
   return tnum;
index cbd37266602828925d244f3b2d65578ae47a4e8e..90a278c0be052b9450e2a761d9b10d5ba9d014a8 100644 (file)
@@ -11,6 +11,8 @@ Depends-on:
 error
 errno
 quote
+stdbool
+verify
 xstrtoimax
 xstrtoumax