From 3f5163f53f081d8ab95611056d86bb407b7fe4cc Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 15 Oct 2022 20:59:03 -0700 Subject: [PATCH] cgraph aagerror: squash -Wswitch-default warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- lib/cgraph/scan.l | 2 ++ 1 file changed, 2 insertions(+) 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)); -- 2.40.0