]> granicus.if.org Git - graphviz/commitdiff
gvpack: cast string literal when calling 'agnodeattr'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 14:52:47 +0000 (07:52 -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:178:43: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

cmd/tools/gvpack.c

index c7d8241efd25824b99aa1a790a07f4c4b847370a..8e7687705ca5b755dbaee3b6cf9977cd8091ec0a 100644 (file)
@@ -175,7 +175,7 @@ static void init(int argc, char *argv[], pack_info* pinfo)
     char buf[BUFSIZ];
     char* bp;
 
-    agnodeattr(NULL, "label", NODENAME_ESC);
+    agnodeattr(NULL, (char*)"label", NODENAME_ESC);
     pinfo->mode = l_clust;
     pinfo->margin = CL_OFFSET;
     pinfo->doSplines = TRUE; /* Use edges in packing */