From 7b2d9feb821376603bcbc0707e21edce36109f9a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 21 Aug 2009 14:55:39 +0200 Subject: [PATCH] fish.c: avoid "assignment discards qualifiers..." warning * fish/fish.c (main): Cast-away-const. * fish/fish.h (bad_cast): Define. Safer than using an actual cast. --- fish/fish.c | 2 +- fish/fish.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fish/fish.c b/fish/fish.c index 987df59..9de8e07 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -267,7 +267,7 @@ main (int argc, char *argv[]) *p = '\0'; mp->mountpoint = p+1; } else - mp->mountpoint = "/"; + mp->mountpoint = bad_cast ("/"); mp->device = optarg; mp->next = mps; mps = mp; diff --git a/fish/fish.h b/fish/fish.h index b7ed922..642c269 100644 --- a/fish/fish.h +++ b/fish/fish.h @@ -106,4 +106,10 @@ extern char *try_tilde_expansion (char *path); "reopen", \ "time" +static inline char * +bad_cast (char const *s) +{ + return (char *) s; +} + #endif /* FISH_H */ -- 1.8.3.1