From: Jim Meyering Date: Sun, 19 Nov 2000 07:41:20 +0000 (+0000) Subject: (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum X-Git-Tag: FILEUTILS-4_0_33~67 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=aba2a0fd6d1db0f06fcd8840a538e64391430e38;p=thirdparty%2Fcoreutils.git (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum constants rather than macros. Use values that cannot conflict with C characters or with -1, CHAR_MAX + 1, etc. --- diff --git a/src/sys2.h b/src/sys2.h index ed18a6cbcb..74a9728ce6 100644 --- a/src/sys2.h +++ b/src/sys2.h @@ -427,8 +427,14 @@ char *base_name PARAMS ((char const *)); /* Factor out some of the common --help and --version processing code. */ -#define GETOPT_HELP_CHAR 250 -#define GETOPT_VERSION_CHAR 251 +/* These enum values cannot possibly conflict with the option values + ordinarily used by commands, including CHAR_MAX + 1, etc. Avoid + CHAR_MIN - 1, as it may equal -1, the getopt end-of-options value. */ +enum +{ + GETOPT_HELP_CHAR = (CHAR_MIN - 2), + GETOPT_VERSION_CHAR = (CHAR_MIN - 3) +}; #define GETOPT_HELP_OPTION_DECL \ "help", no_argument, 0, GETOPT_HELP_CHAR