fish.c: avoid "assignment discards qualifiers..." warning
authorJim Meyering <meyering@redhat.com>
Fri, 21 Aug 2009 12:55:39 +0000 (14:55 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 21 Aug 2009 13:24:25 +0000 (15:24 +0200)
* fish/fish.c (main): Cast-away-const.
* fish/fish.h (bad_cast): Define.  Safer than using an actual cast.

fish/fish.c
fish/fish.h

index 987df59..9de8e07 100644 (file)
@@ -267,7 +267,7 @@ main (int argc, char *argv[])
         *p = '\0';
         mp->mountpoint = p+1;
       } else
         *p = '\0';
         mp->mountpoint = p+1;
       } else
-        mp->mountpoint = "/";
+        mp->mountpoint = bad_cast ("/");
       mp->device = optarg;
       mp->next = mps;
       mps = mp;
       mp->device = optarg;
       mp->next = mps;
       mps = mp;
index b7ed922..642c269 100644 (file)
@@ -106,4 +106,10 @@ extern char *try_tilde_expansion (char *path);
   "reopen",                            \
   "time"
 
   "reopen",                            \
   "time"
 
+static inline char *
+bad_cast (char const *s)
+{
+  return (char *) s;
+}
+
 #endif /* FISH_H */
 #endif /* FISH_H */