mirror of
https://github.com/python/cpython.git
synced 2025-09-10 10:47:34 +00:00
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).
This commit is contained in:
parent
7fbce56a57
commit
4bb31e90f0
1 changed files with 6 additions and 0 deletions
|
@ -122,7 +122,13 @@ findlabel(labellist *ll, int type, const char *str)
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Label %d/'%s' not found\n", type, str);
|
fprintf(stderr, "Label %d/'%s' not found\n", type, str);
|
||||||
Py_FatalError("grammar.c:findlabel()");
|
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 */
|
return 0; /* Make gcc -Wall happy */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Forward */
|
/* Forward */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue