From: Paul Eggert Date: Tue, 22 Oct 2002 05:06:21 +0000 (+0000) Subject: (getargs): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0. X-Git-Tag: BISON-1_875~404 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0df27e8b2d9d6fb2d49392acf6581cfcf8ea5093;p=platform%2Fupstream%2Fbison.git (getargs): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0. Remove duplicate code for "Try `bison --help'". (usage): Add __attribute__((__noreturn__)). --- diff --git a/src/getargs.c b/src/getargs.c index 450a9fa..37d5985 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -155,6 +155,8 @@ report_argmatch (char *args) | Display the help message and exit STATUS. | `-------------------------------------------*/ +static void usage (int) ATTRIBUTE_NORETURN; + static void usage (int status) { @@ -337,11 +339,11 @@ getargs (int argc, char *argv[]) break; case 'h': - usage (0); + usage (EXIT_SUCCESS); case 'V': version (); - exit (0); + exit (EXIT_SUCCESS); case 'g': /* Here, the -g and --graph=FILE options are differentiated. */ @@ -405,9 +407,7 @@ getargs (int argc, char *argv[]) break; default: - fprintf (stderr, _("Try `%s --help' for more information.\n"), - program_name); - exit (1); + usage (EXIT_FAILURE); } if (argc - optind != 1)