-
-
Notifications
You must be signed in to change notification settings - Fork 416
Description
The number of compiler warnings are very high, with gcc there are about 140 and with clang about 300 warnings. Most are perhaps trivial and just annoyance, but who knows...
They not only add a lot of noise to build log (you might add to these some 200+ OpenGL deprecation warnings for Mac, and the ctypes warnings addressed in #507), they also make it very difficult to discover any new potential problems.
Describe the solution you'd like
The best would be to address the warnings in the source.
Describe alternatives you've considered
It is possible, but in general not advisable, to suppress the warnings with compiler flags.
Additional context
Warning Type (No. of Warnings)
Apple clang version 12.0.0 (clang-1200.0.32.21)
- -W#warnings (16) (these warnings are all related to ctypesgen and out of scope for this PR)
- -Wabsolute-value (41) Fix compiler warnings, part 1 #1248
- -Warray-bounds (2) Fix compiler warnings, part 1 #1248
- -Wc++11-compat-deprecated-writable-strings (4) Fix compiler warnings, part 1 #1248
- -Wdangling-else (1) Fix compiler warnings, part 1 #1248
- -Wdeprecated-declarations (2) (see issue [Bug] Use of deprecated sbrk #712)
- -Wformat (83) Fix compiler warnings, part 2 #1256 Fix compiler warnings, part 9 #1316
- -Wformat-extra-args (2) Fix compiler warnings, part 6 #1274 Fix compiler warnings, part 10 #1395
- -Wformat-invalid-specifier (4) Fix compiler warnings, part 6 #1274
- -Wheader-guard (8) Fix compiler warnings, part 8 #1276
- -Wincompatible-pointer-types (1) Fix compiler warnings, part 5 (rst/interpfl lib & v.surf.rst) #1271
- -Wincompatible-pointer-types-discards-qualifiers (15) Fix compiler warnings, part 8 #1276
- -Winteger-overflow (1) Fix compiler warnings, part 7 #1275
- -Wlogical-not-parentheses (5) Fix compiler warnings, part 7 #1275
- -Wmacro-redefined (3) Fix compiler warnings, part 3 #1263
- -Wnon-literal-null-conversion (7) Fix compiler warnings, part 3 #1263
- -Wparentheses (2) Fix compiler warnings, part 6 #1274
- -Wparentheses-equality (3) Fix compiler warnings, part 6 #1274
- -Wpointer-bool-conversion (51) Fix compiler warnings, part 3 #1263
- -Wpointer-compare (4) Fix compiler warnings, part 4 #1265
- -Wpointer-sign (19) Fix compiler warnings, part 4 #1265
- -Wswitch (1) PROJ6+ + WKT2 support #1240
- -Wtautological-compare (1) Fix compiler warnings, part 6 #1274
- -Wtautological-pointer-compare (1) Fix compiler warnings, part 4 #1265
- -Wundefined-inline (16) Fix compiler warnings, part 7 #1275
- -Wunused-result (8) Fix compiler warnings, part 8 #1276 (PROJ6+ + WKT2 support #1240)
- -Wunused-value (1) Fix compiler warnings, part 7 #1275
- -Wwritable-strings (5) Fix compiler warnings, part 7 #1275
gcc -std=gnu17 x86_64-pc-linux-gnu (CI)
- -Wdiscarded-qualifiers (15) Fix compiler warnings, part 8 #1276
- -Wformat-extra-args (3) (Fix compiler warnings, part 6 #1274)
- -Wformat-overflow= (66) Fix compiler warnings, part 12 #1406
- -Wformat-zero-length (6) Fix compiler warnings, part 11 #1405
- -Wformat= (21) Fix compiler warnings, part 2 #1256 (Fix compiler warnings, part 6 #1274) Fix compiler warnings, part 9 #1316
- -Wimplicit-int (2) Fix compiler warnings, part 11 #1405
- -Wincompatible-pointer-types (1) Fix compiler warnings, part 5 (rst/interpfl lib & v.surf.rst) #1271
- -Woverflow (1) Fix compiler warnings, part 7 #1275
- -Wpointer-compare (4) Fix compiler warnings, part 4 #1265
- -Wpointer-to-int-cast (8) Fix compiler warnings, part 11 #1405
- -Wunused-result (8) Fix compiler warnings, part 8 #1276 (PROJ6+ + WKT2 support #1240)
- -Wwrite-strings (4) Fix compiler warnings, part 1 #1248
OSGeo4W (CI)
- -Waggressive-loop-optimizations (3) Fix compiler warnings, part 1 #1248
- -Wdiscarded-qualifiers (17) (Fix compiler warnings, part 8 #1276)
- -Wimplicit-int (2) Fix compiler warnings, part 11 #1405
- -Wincompatible-pointer-types (4) (Fix compiler warnings, part 5 (rst/interpfl lib & v.surf.rst) #1271)
- -Woverflow (1) Fix compiler warnings, part 7 #1275
- -Wpointer-compare (4) Fix compiler warnings, part 4 #1265
- -Wpointer-to-int-cast (9)
- -Wstringop-overflow= (2)
- -Wunused-result (8) Fix compiler warnings, part 8 #1276 (PROJ6+ + WKT2 support #1240)
- -Wwrite-strings (4) Fix compiler warnings, part 1 #1248