]> granicus.if.org Git - graphviz/commitdiff
gvpack: use a const char array instead of mutable variable for usage string
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 00:15:20 +0000 (17:15 -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:82:5: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

cmd/tools/gvpack.c

index 2d8297b87e9030ad7af4e363fd337ccb8da4ab3f..ecb351813a14bf0e8583fc9cfd12e8607a8fa9ca 100644 (file)
@@ -78,7 +78,7 @@ static char* gname = (char*)"root";
 
 #define NEWNODE(n) ((node_t*)ND_alg(n))
 
-static char *useString =
+static const char useString[] =
     "Usage: gvpack [-gnuv?] [-m<margin>] {-array[_rc][n]] [-o<outf>] <files>\n\
   -n          - use node granularity\n\
   -g          - use graph granularity\n\