]> granicus.if.org Git - graphviz/commitdiff
gvpack: cast assignment of string literal to mutable variable
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 00:11:34 +0000 (17:11 -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:77:22: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

cmd/tools/gvpack.c

index ac8a54c936145487f2cb1f4113526125c6b7e2d6..2d8297b87e9030ad7af4e363fd337ccb8da4ab3f 100644 (file)
@@ -74,7 +74,7 @@ static int G_cnt;             /* No. of -G arguments */
 static int G_sz;               /* Storage size for -G arguments */
 static attr_t *G_args;         /* Storage for -G arguments */
 static bool doPack;              /* Do packing if true */
-static char* gname = "root";
+static char* gname = (char*)"root";
 
 #define NEWNODE(n) ((node_t*)ND_alg(n))