summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-19 13:11:56 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-08-19 13:11:56 (GMT)
commit4bb31e90f0ec07188183e318a7c86f81c2023ed0 (patch)
tree1004c5f1289d711f35ad26b2473a9560e2accb90 /Parser
parent7fbce56a57bd8ef45191eb8e4abb4b5d8edb1384 (diff)
downloadcpython-4bb31e90f0ec07188183e318a7c86f81c2023ed0.zip
cpython-4bb31e90f0ec07188183e318a7c86f81c2023ed0.tar.gz
cpython-4bb31e90f0ec07188183e318a7c86f81c2023ed0.tar.bz2
Fix a clang warning in grammar.c
Clang is smarter than GCC and emits a warning for dead code after a function declared with __attribute__((__noreturn__)) (Py_FatalError).
Diffstat (limited to 'Parser')
-rw-r--r--Parser/grammar.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Parser/grammar.c b/Parser/grammar.c
index b598294..e2cce28 100644
--- a/Parser/grammar.c
+++ b/Parser/grammar.c
@@ -122,7 +122,13 @@ findlabel(labellist *ll, int type, const char *str)
}
fprintf(stderr, "Label %d/'%s' not found\n", type, str);
Py_FatalError("grammar.c:findlabel()");
+
+ /* Py_FatalError() is declared with __attribute__((__noreturn__)).
+ GCC emits a warning without "return 0;" (compiler bug!), but Clang is
+ smarter and emits a warning on the return... */
+#ifndef __clang__
return 0; /* Make gcc -Wall happy */
+#endif
}
/* Forward */