Do not output a warning about a missing "return" in a function if the function
exit is unreachable.
This commit is contained in:
@@ -156,7 +156,7 @@ $(WORKDIR)/flow-do-01.$1.$2.prg: flow-do-01.c $(ISEQUAL) | $(WORKDIR)
|
||||
$(if $(QUIET),echo misc/flow-do-01.$1.$2.prg)
|
||||
$(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLOUT) 2>$(WORKDIR)/flow-do-01.$1.$2.out
|
||||
$(ISEQUAL) $(WORKDIR)/flow-do-01.$1.$2.out flow-do-01.ref
|
||||
|
||||
|
||||
$(WORKDIR)/flow-if-01.$1.$2.prg: flow-if-01.c $(ISEQUAL) | $(WORKDIR)
|
||||
$(if $(QUIET),echo misc/flow-if-01.$1.$2.prg)
|
||||
$(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLOUT) 2>$(WORKDIR)/flow-if-01.$1.$2.out
|
||||
@@ -182,7 +182,7 @@ $(WORKDIR)/flow-while-02.$1.$2.prg: flow-while-02.c $(ISEQUAL) | $(WORKDIR)
|
||||
$(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLOUT) 2>$(WORKDIR)/flow-while-02.$1.$2.out
|
||||
$(ISEQUAL) $(WORKDIR)/flow-while-02.$1.$2.out flow-while-02.ref
|
||||
|
||||
$(WORKDIR)/limits.$1.$2.prg: limits.c $(ISEQUAL) | $(WORKDIR)
|
||||
$(WORKDIR)/limits.$1.$2.prg: limits.c $(ISEQUAL) | $(WORKDIR)
|
||||
$(if $(QUIET),echo misc/limits.$1.$2.prg)
|
||||
$(CC65) -t sim$2 -$1 -o $$(@:.prg=.s) $$< $(NULLOUT) $(CATERR)
|
||||
$(CA65) -t sim$2 -o $$(@:.prg=.o) $$(@:.prg=.s) $(NULLERR)
|
||||
|
||||
@@ -43,7 +43,7 @@ static int f4(void)
|
||||
static int f5(void)
|
||||
{
|
||||
do {
|
||||
if (a == 2) {
|
||||
if (a == 2) {
|
||||
break;
|
||||
}
|
||||
return a;
|
||||
@@ -56,7 +56,7 @@ static int f5(void)
|
||||
static int f6(void)
|
||||
{
|
||||
do {
|
||||
if (a == 2) {
|
||||
if (a == 2) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
@@ -69,11 +69,11 @@ static int f6(void)
|
||||
static int f7(void)
|
||||
{
|
||||
do {
|
||||
if (a == 2) {
|
||||
if (a == 2) {
|
||||
return a;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} while (1);
|
||||
/* Unreachable */
|
||||
a = 2;
|
||||
|
||||
@@ -14,7 +14,7 @@ static int f2(void)
|
||||
{
|
||||
if (0) {
|
||||
/* Unreachable */
|
||||
a = 1;
|
||||
a = 1;
|
||||
} else {
|
||||
a = 2;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ static int f4(void)
|
||||
a = 2;
|
||||
} else {
|
||||
/* Unreachable */
|
||||
a = 1;
|
||||
a = 1;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user