[Python-checkins] cpython: Got rid of warnings "suggest braces around empty body in an ‘else’

serhiy.storchaka python-checkins at python.org
Fri Apr 3 14:25:52 CEST 2015


https://hg.python.org/cpython/rev/5795e7a85aee
changeset:   95413:5795e7a85aee
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Apr 03 15:24:33 2015 +0300
summary:
  Got rid of warnings "suggest braces around empty body in an ‘else’ statement"
in Parser/pgen.c.

files:
  Parser/pgen.c |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Parser/pgen.c b/Parser/pgen.c
--- a/Parser/pgen.c
+++ b/Parser/pgen.c
@@ -136,11 +136,12 @@
 
 static char REQNFMT[] = "metacompile: less than %d children\n";
 
-#define REQN(i, count) \
+#define REQN(i, count) do { \
     if (i < count) { \
         fprintf(stderr, REQNFMT, count); \
         Py_FatalError("REQN"); \
-    } else
+    } \
+} while (0)
 
 #else
 #define REQN(i, count)  /* empty */

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list