]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: mark some _Noreturn functions
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Feb 2022 03:55:54 +0000 (19:55 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Feb 2022 06:09:37 +0000 (22:09 -0800)
* src/basenc.c (finish_and_exit, do_encode, do_decode):
* src/comm.c (compare_files):
* src/tsort.c (tsort):
* src/uptime.c (uptime):
Mark with _Noreturn.  Otherwise, unoptimized compilations may warn
that the calling renamed-main function doesn't return a value,
when !lint and when single-binary.

src/basenc.c
src/comm.c
src/tsort.c
src/uptime.c

index b375459294cbbc97b06cc8baaf1f5434062bb274..04857d59e9f17776da87ffe68ebd5a4e27b1e1a5 100644 (file)
@@ -949,7 +949,7 @@ wrap_write (char const *buffer, idx_t len,
       }
 }
 
-static void
+static _Noreturn void
 finish_and_exit (FILE *in, char const *infile)
 {
   if (fclose (in) != 0)
@@ -963,7 +963,7 @@ finish_and_exit (FILE *in, char const *infile)
   exit (EXIT_SUCCESS);
 }
 
-static void
+static _Noreturn void
 do_encode (FILE *in, char const *infile, FILE *out, idx_t wrap_column)
 {
   idx_t current_column = 0;
@@ -1007,7 +1007,7 @@ do_encode (FILE *in, char const *infile, FILE *out, idx_t wrap_column)
   finish_and_exit (in, infile);
 }
 
-static void
+static _Noreturn void
 do_decode (FILE *in, char const *infile, FILE *out, bool ignore_garbage)
 {
   char *inbuf, *outbuf;
index 9cb7a61b0a2ee250ae4e13fea83ffccd31f8a492..947463638fe035ab6d5af6f7f4881a2fe4931b55 100644 (file)
@@ -251,7 +251,7 @@ check_order (struct linebuffer const *prev,
    merge them and output the result.
    Exit the program when done.  */
 
-static void
+static _Noreturn void
 compare_files (char **infiles)
 {
   /* For each file, we have four linebuffers in lba. */
index 19b991beda6e02ef4df50579704d6616ac334429..383c7a083035e259be9bcf7f3130ffda8a2fc8ab 100644 (file)
@@ -428,7 +428,7 @@ walk_tree (struct item *root, bool (*action) (struct item *))
 
 /* Do a topological sort on FILE.  Exit with appropriate exit status.  */
 
-static void
+static _Noreturn void
 tsort (char const *file)
 {
   bool ok = true;
index f1cb84a6bc06b5c1db9fc4964aed1a527a943cc7..1adacaada1bae7b4b61656e91055f70a8c66d4ce 100644 (file)
@@ -173,7 +173,7 @@ print_uptime (size_t n, const STRUCT_UTMP *this)
    according to utmp file FILENAME.  Use read_utmp OPTIONS to read the
    utmp file.  */
 
-static void
+static _Noreturn void
 uptime (char const *filename, int options)
 {
   size_t n_users;