Do not output a warning about a missing "return" in a function if the function

exit is unreachable.
This commit is contained in:
Kugel Fuhr
2025-07-17 16:12:48 +02:00
parent ed54e9b168
commit 6d45a94127
6 changed files with 17 additions and 14 deletions

View File

@@ -47,7 +47,7 @@ static int f5(void)
{
while (1) {
++a;
if (a == 4) goto L;
if (a == 4) goto L;
return a;
}
/* Reachable via L */
@@ -56,8 +56,8 @@ L: a = 2;
static int f6(void)
{
while (0) {
/* Unreachable but no warning */
while (0) {
/* Unreachable but no warning */
}
a = 2;
return a;