]> granicus.if.org Git - graphviz/commitdiff
gvpack: cast assignment of string literal to 'rhs'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 00:21:39 +0000 (17:21 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 25 Apr 2022 02:12:48 +0000 (19:12 -0700)
This pre-emptively squashes an upcoming warning when converting this file to C++
which otherwise fails the CMake build:

  cmd/tools/gvpack.cpp:122:17: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

cmd/tools/gvpack.c

index 8e7687705ca5b755dbaee3b6cf9977cd8091ec0a..5c57a6ef5abaf6237b2b1ae37697d9fc262d1080 100644 (file)
@@ -119,7 +119,7 @@ static FILE *openFile(const char *name)
 static int setNameValue(char *arg)
 {
     char *p;
-    char *rhs = "true";
+    char *rhs = (char*)"true";
 
     if ((p = strchr(arg, '='))) {
        *p++ = '\0';