Previously pngfix had been made warning-free in GCC7.1 by marking auto variables (volatile). This prevented the arithmetic optimizations which caused warnings from GCC7.1 with higher values -Wstrict-overflow=
GCC has moved on a lot since 7.1 and pngfix.c now compiles with just one warning using -Wstrict-overflow=5. The change includes a change to make this go away by performing the rearrangement GCC was using in the code:
i == ndigits-1
becomes:
i+1 == ndigits
i is initialized to ndigits and has been decremented at least once so this is fine.
Test, configure:
CFLAGS="-Wall -Wextra -Wno-maybe-uninitialized -Wstrict-overflow=5" \
../configure --enable-werror
make
make cehck
Previously pngfix had been made warning-free in GCC7.1 by marking auto variables (volatile). This prevented the arithmetic optimizations which caused warnings from GCC7.1 with higher values -Wstrict-overflow=
GCC has moved on a lot since 7.1 and pngfix.c now compiles with just one warning using -Wstrict-overflow=5. The change includes a change to make this go away by performing the rearrangement GCC was using in the code:
i == ndigits-1
becomes:
i+1 == ndigits
i is initialized to ndigits and has been decremented at least once so this is fine.
Test, configure:
CFLAGS="-Wall -Wextra -Wno-maybe-uninitialized -Wstrict-overflow=5" \ ../configure --enable-werror make make cehck
Test, cmake:
cmake .. make make test