From df81ab2911ce995fb9e116550b7a6798b497e391 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 5 Nov 2003 03:53:19 +0000 Subject: [PATCH] Cast NULL to `(char *)' in call to variadic function, parse_long_options, so that it works even on systems for which sizeof char* != sizeof int. --- src/basename.c | 2 +- src/chroot.c | 2 +- src/cksum.c | 2 +- src/dd.c | 2 +- src/dirname.c | 2 +- src/echo.c | 2 +- src/expr.c | 2 +- src/factor.c | 2 +- src/hostid.c | 2 +- src/hostname.c | 2 +- src/link.c | 2 +- src/logname.c | 2 +- src/nice.c | 2 +- src/nohup.c | 2 +- src/pathchk.c | 2 +- src/printenv.c | 2 +- src/printf.c | 2 +- src/pwd.c | 2 +- src/setuidgid.c | 2 +- src/sleep.c | 2 +- src/stty.c | 2 +- src/sync.c | 2 +- src/test.c | 2 +- src/tsort.c | 2 +- src/unlink.c | 2 +- src/uptime.c | 2 +- src/users.c | 2 +- src/whoami.c | 2 +- src/yes.c | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/basename.c b/src/basename.c index 9ba33c3..2bf1630 100644 --- a/src/basename.c +++ b/src/basename.c @@ -100,7 +100,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ if (argc > 1 && STREQ (argv[1], "--")) diff --git a/src/chroot.c b/src/chroot.c index d808908..8095f2e 100644 --- a/src/chroot.c +++ b/src/chroot.c @@ -72,7 +72,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); if (argc <= 1) { error (0, 0, _("too few arguments")); diff --git a/src/cksum.c b/src/cksum.c index c991181..9253d9b 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -309,7 +309,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); have_read_stdin = 0; diff --git a/src/dd.c b/src/dd.c index 5300d3b..6ab7c3d 100644 --- a/src/dd.c +++ b/src/dd.c @@ -1161,7 +1161,7 @@ main (int argc, char **argv) atexit (close_stdout_wrapper); parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* Don't close stdout on exit from here on. */ closeout_func = NULL; diff --git a/src/dirname.c b/src/dirname.c index 9eee822..347623d 100644 --- a/src/dirname.c +++ b/src/dirname.c @@ -75,7 +75,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ if (argc > 1 && STREQ (argv[1], "--")) diff --git a/src/echo.c b/src/echo.c index 658ceea..bd79cc9 100644 --- a/src/echo.c +++ b/src/echo.c @@ -127,7 +127,7 @@ main (int argc, char **argv) /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ if (getenv ("POSIXLY_CORRECT") == NULL) parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL, NULL); + usage, AUTHORS, (char const *) NULL, NULL); else allow_options = 0; diff --git a/src/expr.c b/src/expr.c index 8b75621..f75fb8e 100644 --- a/src/expr.c +++ b/src/expr.c @@ -188,7 +188,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ if (argc > 1 && STREQ (argv[1], "--")) diff --git a/src/factor.c b/src/factor.c index 03be106..f105826 100644 --- a/src/factor.c +++ b/src/factor.c @@ -202,7 +202,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ if (argc > 1 && STREQ (argv[1], "--")) diff --git a/src/hostid.c b/src/hostid.c index 1f89fda..1f10480 100644 --- a/src/hostid.c +++ b/src/hostid.c @@ -69,7 +69,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); if (argc > 1) { diff --git a/src/hostname.c b/src/hostname.c index 5aedf29..52c1892 100644 --- a/src/hostname.c +++ b/src/hostname.c @@ -91,7 +91,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); #ifdef HAVE_SETHOSTNAME if (argc == 2) diff --git a/src/link.c b/src/link.c index d0ae1ed..41d4a71 100644 --- a/src/link.c +++ b/src/link.c @@ -73,7 +73,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ diff --git a/src/logname.c b/src/logname.c index a10de9f..455cea6 100644 --- a/src/logname.c +++ b/src/logname.c @@ -72,7 +72,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/nice.c b/src/nice.c index 003fa1f..6d25959 100644 --- a/src/nice.c +++ b/src/nice.c @@ -99,7 +99,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); for (i = 1; i < argc; /* empty */) { diff --git a/src/nohup.c b/src/nohup.c index a8772f8..6d006f2 100644 --- a/src/nohup.c +++ b/src/nohup.c @@ -86,7 +86,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Now, handle `--'. */ diff --git a/src/pathchk.c b/src/pathchk.c index 17638de..40178cc 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -166,7 +166,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((optc = getopt_long (argc, argv, "p", longopts, NULL)) != -1) { diff --git a/src/printenv.c b/src/printenv.c index 033e98e..a956d25 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -94,7 +94,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/printf.c b/src/printf.c index b5d1cb5..f3ad462 100644 --- a/src/printf.c +++ b/src/printf.c @@ -566,7 +566,7 @@ main (int argc, char **argv) posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); if (!posixly_correct) parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ diff --git a/src/pwd.c b/src/pwd.c index 17a80a6..5964734 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -68,7 +68,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); if (1 < argc) error (0, 0, _("ignoring non-option arguments")); diff --git a/src/setuidgid.c b/src/setuidgid.c index e19acf3..79e7438 100644 --- a/src/setuidgid.c +++ b/src/setuidgid.c @@ -83,7 +83,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ diff --git a/src/sleep.c b/src/sleep.c index 9e98693..9c96ab3 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -120,7 +120,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/stty.c b/src/stty.c index d47ab2f..ec7b527 100644 --- a/src/stty.c +++ b/src/stty.c @@ -750,7 +750,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); output_type = changed; verbose_output = 0; diff --git a/src/sync.c b/src/sync.c index 13e53f6..6d98b5d 100644 --- a/src/sync.c +++ b/src/sync.c @@ -65,7 +65,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); if (1 < argc) error (0, 0, _("ignoring all arguments")); diff --git a/src/test.c b/src/test.c index 24d347e..9cd691a 100644 --- a/src/test.c +++ b/src/test.c @@ -1101,7 +1101,7 @@ main (int margc, char **margv) if (margc < 2 || strcmp (margv[margc - 1], "]") != 0) { parse_long_options (margc, margv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); test_syntax_error (_("missing `]'\n"), NULL); } diff --git a/src/tsort.c b/src/tsort.c index 3cae86d..bf680c5 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -560,7 +560,7 @@ main (int argc, char **argv) exit_status = 0; parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((opt = getopt_long (argc, argv, "", long_options, NULL)) != -1) switch (opt) diff --git a/src/unlink.c b/src/unlink.c index 6d3257e..f283b17 100644 --- a/src/unlink.c +++ b/src/unlink.c @@ -74,7 +74,7 @@ main (int argc, char **argv) /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ if (getenv ("POSIXLY_CORRECT") == NULL) parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ diff --git a/src/uptime.c b/src/uptime.c index 371e60b..b039f01 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -216,7 +216,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((optc = getopt_long (argc, argv, "", longopts, &longind)) != -1) { diff --git a/src/users.c b/src/users.c index d53d337..7fbc8c6 100644 --- a/src/users.c +++ b/src/users.c @@ -143,7 +143,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((optc = getopt_long (argc, argv, "", longopts, &longind)) != -1) { diff --git a/src/whoami.c b/src/whoami.c index c113ba3..8b4318d 100644 --- a/src/whoami.c +++ b/src/whoami.c @@ -77,7 +77,7 @@ main (int argc, char **argv) atexit (close_stdout); parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) { diff --git a/src/yes.c b/src/yes.c index 65e5342..e58d63f 100644 --- a/src/yes.c +++ b/src/yes.c @@ -74,7 +74,7 @@ main (int argc, char **argv) /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ if (getenv ("POSIXLY_CORRECT") == NULL) parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, NULL); + usage, AUTHORS, (char const *) NULL); if (argc == 1) { -- 2.7.4