From: Matthew Fernandez Date: Sun, 16 Oct 2022 03:59:03 +0000 (-0700) Subject: cgraph aagerror: squash -Wswitch-default warning X-Git-Tag: 7.0.0~2^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f5163f53f081d8ab95611056d86bb407b7fe4cc;p=graphviz cgraph aagerror: squash -Wswitch-default warning Squashes: ../../lib/cgraph/scan.l: In function ‘aagerror’: ../../lib/cgraph/scan.l:232:14: warning: switch missing default case [-Wswitch-default] 232 | else switch (YYSTATE) { | ^~~~~~ This switch is adding more information to the error message based on which lexing state we are in, of which four are defined: `INITIAL` (the built-in start state), `comment`, `hstring`, and `qstring`. In the `INITIAL` state there is no extra information to add. --- diff --git a/lib/cgraph/scan.l b/lib/cgraph/scan.l index ee8e60f0c..8dfb23a9d 100644 --- a/lib/cgraph/scan.l +++ b/lib/cgraph/scan.l @@ -255,6 +255,8 @@ void aagerror(const char *str) case comment : agxbprint(&xb, " scanning a /*...*/ comment (missing '*/? longer than %d?)", YY_BUF_SIZE); break; + default: // nothing extra to note + break; } agxbputc (&xb, '\n'); agerr(AGERR, "%s", agxbuse(&xb));