summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2017-02-11 11:51:43 +0000
committerSami Kerola <kerolasa@iki.fi>2017-02-11 11:58:50 +0000
commit976cca6eb0ec9f60bf4b4f0f0176e638ce015784 (patch)
tree22b26a59a702ba77d661e4a2bf1991b1880da86b /src
parentea0f8691df45880c536a04e42d3a7a46f21921ae (diff)
hello: Mark print_help() not to return
* bootstrap.conf: include stdnoreturn module. * src/hello.c: mark print_help() not to return, and remove unreachable code. Reference: https://www.gnu.org/software/gnulib/manual/html_node/ stdnoreturn_002eh.html
Diffstat (limited to 'src')
-rw-r--r--src/hello.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hello.c b/src/hello.c
index 8e6cfbd..55edfa4 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -18,6 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <stdnoreturn.h>
+
#include "system.h"
#include "errno.h"
#include "error.h"
@@ -25,7 +27,7 @@
#include "xalloc.h"
/* Forward declarations. */
-static void print_help (FILE *out);
+static _Noreturn void print_help (FILE *restrict out);
static void print_version (void);
int
@@ -82,8 +84,6 @@ main (int argc, char *argv[])
break;
case OPT_HELP:
print_help (stdout);
- exit (EXIT_SUCCESS);
- break;
case 't':
greeting_msg = _("hello, world");
break;
@@ -117,8 +117,8 @@ main (int argc, char *argv[])
several pieces to help translators be able to align different
blocks and identify the various pieces. */
-static void
-print_help (FILE *out)
+static _Noreturn void
+print_help (FILE *restrict out)
{
const char *lc_messages = setlocale (LC_MESSAGES, NULL);
/* TRANSLATORS: --help output 1 (synopsis)