From: NHOrus Date: Thu, 8 Mar 2018 12:20:14 +0000 (+0300) Subject: Additional warnings X-Git-Tag: 1.5~12 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=5cdaa301dcf6ececc1d2a9e340d8da698a9f55d8 Additional warnings One of the two is fixed and GCC-exclusive, will cause more warnings on Clang --- diff --git a/Makefile b/Makefile index 506a6f6..8836d1a 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,8 @@ linty: CCFLAGS += -Wstrict-prototypes linty: CCFLAGS += -Wmissing-prototypes linty: CCFLAGS += -Wmissing-declarations linty: CCFLAGS += -Wshadow +linty: CCFLAGS += -Wnull-dereference +linty: CCFLAGS += -Wjump-misses-init linty: CCFLAGS += -Wfloat-equal linty: CCFLAGS += -Wcast-align linty: CCFLAGS += -Wwrite-strings diff --git a/main.c b/main.c index 1b725c9..f0dbb3a 100644 --- a/main.c +++ b/main.c @@ -694,14 +694,16 @@ static void playermove( int motion) * to get it out. Having dropped it, go back and * pretend he wasn't carrying it after all. */ drop(EMERALD, game.loc); - int te_tmp = travel_entry; - do { - if (travel[te_tmp].stop) - BUG(CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION); // LCOV_EXCL_LINE - ++te_tmp; - } while - (traveleq(travel_entry, te_tmp)); - travel_entry = te_tmp; + { + int te_tmp = travel_entry; + do { + if (travel[te_tmp].stop) + BUG(CONDITIONAL_TRAVEL_ENTRY_WITH_NO_ALTERATION); // LCOV_EXCL_LINE + ++te_tmp; + } while + (traveleq(travel_entry, te_tmp)); + travel_entry = te_tmp; + } continue; /* goto L12 */ case 3: /* Special travel 3. Troll bridge. Must be done