bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/5] style: clarify control flow


From: Akim Demaille
Subject: [PATCH 3/5] style: clarify control flow
Date: Sun, 7 Jul 2019 15:59:23 +0200

* src/getargs.c (language_argmatch): Initialize msg.
Check it instead of relying on a return.
---
 src/getargs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/getargs.c b/src/getargs.c
index 7b8851d5..ea2a0fd6 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -506,7 +506,7 @@ skeleton_arg (char const *arg, int prio, location loc)
 void
 language_argmatch (char const *arg, int prio, location loc)
 {
-  char const *msg;
+  char const *msg = NULL;
 
   if (prio < language_prio)
     {
@@ -521,10 +521,9 @@ language_argmatch (char const *arg, int prio, location loc)
     }
   else if (language_prio == prio)
     msg = _("multiple language declarations are invalid");
-  else
-    return;
 
-  complain (&loc, complaint, msg, quotearg_colon (arg));
+  if (msg)
+    complain (&loc, complaint, msg, quotearg_colon (arg));
 }
 
 /*----------------------.
-- 
2.22.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]