Make sure, the command line setting for the "Unreachable code" warning is
checked in all cases before outputting such a warning. Fixes #2655.
This commit is contained in:
@@ -134,6 +134,11 @@ $(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR)
|
||||
|
||||
# these need reference data that can't be generated by a host-compiled program,
|
||||
# in a useful way
|
||||
$(WORKDIR)/bug2655.$1.$2.prg: bug2655.c $(ISEQUAL) | $(WORKDIR)
|
||||
$(if $(QUIET),echo misc/bug2655.$1.$2.prg)
|
||||
$(CC65) -t sim$2 -$1 -o $$@ $$< 2>$(WORKDIR)/bug2655.$1.$2.out
|
||||
$(ISEQUAL) $(WORKDIR)/bug2655.$1.$2.out bug2655.ref
|
||||
|
||||
$(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) $$< $(NULLERR)
|
||||
|
||||
18
test/misc/bug2655.c
Normal file
18
test/misc/bug2655.c
Normal file
@@ -0,0 +1,18 @@
|
||||
void f1(void)
|
||||
{
|
||||
if (1) {
|
||||
f1();
|
||||
} else {
|
||||
f1();
|
||||
}
|
||||
}
|
||||
|
||||
void f2(void)
|
||||
{
|
||||
if (0) {
|
||||
f2();
|
||||
} else {
|
||||
f2();
|
||||
}
|
||||
}
|
||||
|
||||
2
test/misc/bug2655.ref
Normal file
2
test/misc/bug2655.ref
Normal file
@@ -0,0 +1,2 @@
|
||||
bug2655.c:5: Warning: Unreachable code
|
||||
bug2655.c:12: Warning: Unreachable code
|
||||
Reference in New Issue
Block a user