summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-01-31 19:55:54 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-01-31 22:09:37 -0800
commitbcc479b0b56e7105b46bbfa962ba28feea3c50fe (patch)
tree8ad2628fc6f16fb2f20010de43d0b3c9f1041127 /src
parentfb7579768d688a300c4ac76451e1fc7cad59e3e8 (diff)
downloadcoreutils-bcc479b0b56e7105b46bbfa962ba28feea3c50fe.tar.gz
coreutils-bcc479b0b56e7105b46bbfa962ba28feea3c50fe.zip
maint: mark some _Noreturn functions
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/basenc.c6
-rw-r--r--src/comm.c2
-rw-r--r--src/tsort.c2
-rw-r--r--src/uptime.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/basenc.c b/src/basenc.c
index b37545929..04857d59e 100644
--- a/src/basenc.c
+++ b/src/basenc.c
@@ -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;
diff --git a/src/comm.c b/src/comm.c
index 9cb7a61b0..947463638 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -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. */
diff --git a/src/tsort.c b/src/tsort.c
index 19b991bed..383c7a083 100644
--- a/src/tsort.c
+++ b/src/tsort.c
@@ -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;
diff --git a/src/uptime.c b/src/uptime.c
index f1cb84a6b..1adacaada 100644
--- a/src/uptime.c
+++ b/src/uptime.c
@@ -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;