Skip to content

Fix more warnings

A couple more simple fixes, from pedantic clang warnings:

  • First, add an explicit rule for compile, since it's picking up CFLAGS from the environment, and not using CCFLAGS in the Makefile. An alternative solution would be to simply change CCFLAGS to CFLAGS, but having an explicit rule doesn't hurt either way.
  • Cast the result of sizeof(INLINE) to a long to silence a warning. We could also that variable to be unsigned long but that would require changing other places, and I think it's unlikely that sizeof(INLINE) will exceed LONG_MAX. This seems reasonable until better refactoring can occur.
  • Add braces around the initialization of the two-dimensional array RUNS[7][2] for clarity.

Warnings fixed:

misc.c:901:14: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
                for (I=1; I<=sizeof(INLINE) && INLINE[I]!=0; I++) {
                          ~^ ~~~~~~~~~~~~~~
misc.c:940:27: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                          ^~~~~
                          {    }
misc.c:940:34: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                                 ^~~~~
                                 {    }
misc.c:940:41: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                                        ^~~~~
                                        {    }
misc.c:940:48: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                                               ^~~~~~
                                               {     }
misc.c:940:56: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                                                       ^~~~~
                                                       {    }
misc.c:940:63: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                                                              ^~~~~
                                                              {    }
misc.c:940:70: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static long RUNS[7][2] = {32,34, 39,46, 65,90, 97,122, 37,37, 48,57, 0,126};
                                                                     ^~~~~
                                                                     {    }
8 warnings generated.```

Merge request reports

Loading