From: Jim Meyering Date: Fri, 21 Aug 2009 12:55:39 +0000 (+0200) Subject: fish.c: avoid "assignment discards qualifiers..." warning X-Git-Tag: 1.0.69~44 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=7b2d9feb821376603bcbc0707e21edce36109f9a;p=libguestfs.git 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. --- 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 */