Additional warnings 267/head
authorNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 8 Mar 2018 12:20:14 +0000 (15:20 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Thu, 8 Mar 2018 12:20:14 +0000 (15:20 +0300)
One of the two is fixed and GCC-exclusive, will cause more
warnings on Clang

Makefile
main.c

index 506a6f6102a9e8a80da8b1edc0d8be53684eae2d..8836d1ac0874891555bae267907dfa6b418cc1fa 100644 (file)
--- 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 += -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
 linty: CCFLAGS += -Wfloat-equal
 linty: CCFLAGS += -Wcast-align
 linty: CCFLAGS += -Wwrite-strings
diff --git a/main.c b/main.c
index 1b725c96c71e8bfedf72b3a3ed5372251e168c0f..f0dbb3a988fe7461a6ecccddfa7463f27467f3d8 100644 (file)
--- 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);
                      * 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
                     continue; /* goto L12 */
                 case 3:
                     /* Special travel 3.  Troll bridge.  Must be done