bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH x 5] warnings, some legit


From: Paul Eggert
Subject: Re: [PATCH x 5] warnings, some legit
Date: Thu, 16 Oct 2008 13:03:58 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Jim Meyering <address@hidden> writes:

> +#define TMP (char *) "/tmp"
> ...

How about the following change to mktemp.c instead?  It's simpler, and
avoids the need for the macro and the cast.

2008-10-16  Paul Eggert  <address@hidden>

        * src/mktemp.c (main): Add 'const' twice to avoid GCC warning.

diff --git a/src/mktemp.c b/src/mktemp.c
index 0555d41..ffb21d4 100644
--- a/src/mktemp.c
+++ b/src/mktemp.c
@@ -126,8 +126,8 @@ mkdtemp_len (char *tmpl, size_t suff_len, bool dry_run)
 int
 main (int argc, char **argv)
 {
-  char *dest_dir;
-  char *dest_dir_arg = NULL;
+  char const *dest_dir;
+  char const *dest_dir_arg = NULL;
   bool suppress_stderr = false;
   int c;
   unsigned int n_args;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]