liblouis
liblouis copied to clipboard
Fix all compilation warnings
- [x]
passing 'yaml_char_t *' (aka 'unsigned char *') to parameter of type 'const char *' [-Wpointer-sign]
- [x]
assigning to 'char *' from 'yaml_char_t *' (aka 'unsigned char *') [-Wpointer-sign]
- [x]
using the result of an assignment as a condition without parentheses [-Wparentheses]
- [ ]
comparison of unsigned expression < 0 is always false [-Wtautological-compare]
- [ ]
comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
- [x]
'/*' within block comment [-Wcomment]
- [ ]
assigning to 'char *' from 'gl_uint8_t *' (aka 'unsigned char *') [-Wpointer-sign]
- [x]
data argument not used by format string [-Wformat-extra-args]
- [x]
add explicit braces to avoid dangling else [-Wdangling-else]
- [x]
[-Wdiscarded-qualifiers]
(see below)
Possibly there are more if we enable more checks.
Also -Wdiscarded-qualifiers:
brl_checks.c: In function ‘check_full’:
brl_checks.c:176:67: warning: passing argument 10 of ‘lou_backTranslate’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
typeformbuf, NULL, NULL, NULL, cursorPos, mode);
^
In file included from brl_checks.c:20:0:
../liblouis/liblouis.h:156:17: note: expected ‘int *’ but argument is of type ‘const int *’
int EXPORT_CALL lou_backTranslate(const char *tableList, const widechar *inbuf,
^
See also https://www.freelists.org/post/liblouis-liblouisxml/liblouis-340-has-been-released,1
We've enabled all warnings in 5356d84cf25f519bd5553865a015a12407032dd5 so there's hundreds of them now.
With 8734c93b38b37e99209ae879df40aa37caf1cd6e the function check_full
is gone and with it also th e problem with discarded-qualifiers
Cannot find any occurrence of -Wformat-extra-args
in current master
@egli Can I put this in milestone 3.6?
@bertfrees sure you can.
I remember that I ran out of steam on this one. Many of the fixes are kind of mechanical, make the code less readable and the benefit is questionable IMHO.
So while strictly speaking we are not done with this issue I think we fixed most of what actually made sense. Of course it would be nice to have a build without any warnings. Maybe we can selectively disable some.
I asked because the remaining warnings are really annoying me. Not because of what they say but just because they are there. I think there are more (in number) than there were before, because of the -Wall. If we could selectively disable them that would be great.
OK, O'm looking at the warnings now:
32 matches for "\[-W" in buffer: *compilation*
412:compileTranslationTable.c:1628:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
416:compileTranslationTable.c:3867:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
422:compileTranslationTable.c:3968:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
433:lou_translateString.c:1135:2: warning: missing initializer for field ‘length’ of ‘OutString {aka struct <anonymous>}’ [-Wmissing-field-initializers]
439:lou_translateString.c:1180:4: warning: missing initializer for field ‘length’ of ‘OutString {aka struct <anonymous>}’ [-Wmissing-field-initializers]
446:lou_translateString.c:3653:77: warning: unused parameter ‘mode’ [-Wunused-parameter]
450:lou_translateString.c:762:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
457:lou_translateString.c:3450:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
464:lou_translateString.c:1928:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
470:lou_translateString.c:1963:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
477:lou_translateString.c:3260:6: warning: ‘repwordLength’ may be used uninitialized in this function [-Wmaybe-uninitialized]
480:lou_translateString.c:3259:18: warning: ‘repwordStart’ may be used uninitialized in this function [-Wmaybe-uninitialized]
483:lou_translateString.c:3243:6: warning: ‘transCharslen’ may be used uninitialized in this function [-Wmaybe-uninitialized]
486:lou_translateString.c:3298:8: warning: ‘transOpcode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
496:lou_translateString.c:264:3: warning: ‘transOpcode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
502:lou_translateString.c:1170:36: warning: ‘posMapping3’ may be used uninitialized in this function [-Wmaybe-uninitialized]
505:lou_translateString.c:942:9: warning: ‘passPosMapping’ may be used uninitialized in this function [-Wmaybe-uninitialized]
517:lou_translateString.c:1180:11: warning: ‘passbuf2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
525:lou_backTranslateString.c:633:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
532:lou_backTranslateString.c:517:6: warning: ‘multindRule’ may be used uninitialized in this function [-Wmaybe-uninitialized]
540:lou_backTranslateString.c:209:39: warning: ‘src’ may be used uninitialized in this function [-Wmaybe-uninitialized]
556:pattern.c:935:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
563:pattern.c:1246:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
570:pattern.c:949:1: warning: ‘pattern_insert_alternate’ defined but not used [-Wunused-function]
573:pattern.c:465:1: warning: ‘pattern_print’ defined but not used [-Wunused-function]
576:pattern.c:344:1: warning: ‘pattern_output’ defined but not used [-Wunused-function]
584:logging.c:76:30: warning: unused parameter ‘level’ [-Wunused-parameter]
1157:brl_checks.c:374:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
1183:lou_debug.c:102:9: warning: pointer targets in return differ in signedness [-Wpointer-sign]
1195:lou_trace.c:81:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
1199:lou_trace.c:101:9: warning: pointer targets in return differ in signedness [-Wpointer-sign]
1215:lou_checkyaml.c:121:6: warning: unused variable ‘parse_error’ [-Wunused-variable]
-
9 of them are implicit-fallthrough (missing
break
statements inswitch
statements). I find these really hard to fix, as I don't know if this was intentional. I think we should just ignore those. -
5 warnings are in
pattern.c
, unused functions for example. Here I'm not sure if we can just delete Mikes functions even if they're not used. -
10 warnings are maybe-uninitialized. We might have to look at those.
-
There are a few more (5) that I don't quite understand such as
type-limits
,pointer-sign
andsign-compare
I think the missing break statements are all intentional.
But I'm getting a lot more warnings! And I'm not even getting some of the ones you listed here (for instance the implicit-fallthrough ones).
These are the ones I'm getting
compileTranslationTable.c:247:22: warning: comparison of integers of different signs: 'widechar' (aka 'unsigned int') and 'int' [-Wsign-compare] compileTranslationTable.c:984:21: warning: comparison of integers of different signs: 'const widechar' (aka 'const unsigned int') and 'short' [-Wsign-compare] compileTranslationTable.c:1020:13: warning: comparison of unsigned enum expression = 0 is always true [-Wtautological-compare] compileTranslationTable.c:1650:24: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:1712:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:1726:22: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2048:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2050:9: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2129:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2304:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2369:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2417:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2547:22: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2549:22: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2569:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2714:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2716:8: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2781:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2783:8: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2786:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2815:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2823:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2875:16: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:2917:16: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:2931:17: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:2933:9: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:3006:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3010:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3049:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3051:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3401:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3497:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3618:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3630:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3641:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3697:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3715:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3734:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3761:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3780:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3798:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3819:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3828:41: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3841:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3921:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3950:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3952:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:4030:28: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:4537:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] lou_translateString.c:358:25: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_translateString.c:372:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:390:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:598:9: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_translateString.c:616:19: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:632:10: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:761:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:785:9: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:906:57: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] lou_translateString.c:908:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:1407:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] lou_translateString.c:1924:47: warning: missing field 'dotsnext' initializer [-Wmissing-field-initializers] lou_translateString.c:2368:41: warning: missing field 'end' initializer [-Wmissing-field-initializers] lou_translateString.c:3693:77: warning: unused parameter 'mode' [-Wunused-parameter] lou_backTranslateString.c:512:47: warning: missing field 'dotsnext' initializer [-Wmissing-field-initializers] lou_backTranslateString.c:1249:25: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_backTranslateString.c:1264:26: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_backTranslateString.c:1275:16: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_backTranslateString.c:1322:44: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] lou_backTranslateString.c:1401:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_backTranslateString.c:1415:9: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_backTranslateString.c:1506:47: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] lou_backTranslateString.c:1507:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:41:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:46:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:51:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:56:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:61:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:306:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:314:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:436:19: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:445:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:637:22: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:686:22: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:723:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:731:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:739:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:746:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:753:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:760:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:869:48: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:905:48: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:927:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:939:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:956:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:983:20: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1018:20: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1040:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1075:22: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1130:23: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1281:18: warning: comparison of integers of different signs: 'widechar' (aka 'unsigned int') and 'const int' [-Wsign-compare] pattern.c:1556:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:344:1: warning: unused function 'pattern_output' [-Wunused-function] pattern.c:465:1: warning: unused function 'pattern_print' [-Wunused-function] pattern.c:949:1: warning: unused function 'pattern_insert_alternate' [-Wunused-function] logging.c:76:30: warning: unused parameter 'level' [-Wunused-parameter] error.c:390:12: warning: data argument not used by format string [-Wformat-extra-args] brl_checks.c:374:23: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare] lou_debug.c:102:9: warning: returning 'gl_uint8_t [256]' from a function with result type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign] lou_trace.c:81:19: warning: comparison of unsigned expression
OK, so I'm going to disable the implicit-fallthrough warnings.
But I'm getting a lot more warnings!
Do you have a different gcc or a different architecture?
I'm on a 64-bit Intel machine with gcc 7.2.0
Apologies! All this time I though I was using gcc but it appears to be a gcc front-end for llvm.
If I run make CC=/usr/local/bin/gcc-7
(7.2.0 installed from source), I get a slightly different output, but still there are a lot more than your 32. I also have an 64-bit Intel machine by the way.
List of warnings
compileTranslationTable.c:247:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:984:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1062:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1177:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1189:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1296:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1390:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1423:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1424:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1429:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1580:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1596:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1617:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1628:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] compileTranslationTable.c:1650:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1712:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:1726:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2048:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2050:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2129:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2304:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2369:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2417:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2547:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2549:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2569:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2714:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2716:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2781:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2783:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2786:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2815:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2823:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2875:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2917:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2931:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:2933:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3006:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3010:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3049:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3051:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3401:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3497:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3618:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3630:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3641:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3697:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3715:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3734:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3761:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3780:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3798:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3819:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3828:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3841:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3921:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3950:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3952:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:4030:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:4537:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] compileTranslationTable.c:3867:23: warning: this statement may fall through [-Wimplicit-fallthrough=] compileTranslationTable.c:3968:6: warning: this statement may fall through [-Wimplicit-fallthrough=] lou_translateString.c:358:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:372:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:390:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:598:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:616:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:632:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:761:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:785:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:906:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:908:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:1407:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_translateString.c:3693:77: warning: unused parameter 'mode' [-Wunused-parameter] lou_translateString.c:834:8: warning: this statement may fall through [-Wimplicit-fallthrough=] lou_translateString.c:3496:7: warning: this statement may fall through [-Wimplicit-fallthrough=] lou_translateString.c:2017:20: warning: this statement may fall through [-Wimplicit-fallthrough=] lou_translateString.c:2050:10: warning: this statement may fall through [-Wimplicit-fallthrough=] lou_translateString.c:303:3: warning: 'transOpcode' may be used uninitialized in this function [-Wmaybe-uninitialized] lou_translateString.c:1249:36: warning: 'posMapping3' may be used uninitialized in this function [-Wmaybe-uninitialized] lou_translateString.c:1020:9: warning: 'passPosMapping' may be used uninitialized in this function [-Wmaybe-uninitialized] lou_backTranslateString.c:1249:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1264:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1275:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1322:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1401:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1415:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1506:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:1507:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_backTranslateString.c:633:10: warning: this statement may fall through [-Wimplicit-fallthrough=] lou_backTranslateString.c:517:6: warning: 'multindRule' may be used uninitialized in this function [-Wmaybe-uninitialized] lou_backTranslateString.c:209:39: warning: 'src' may be used uninitialized in this function [-Wmaybe-uninitialized] commonTranslationFunctions.c:41:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] commonTranslationFunctions.c:46:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] commonTranslationFunctions.c:51:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] commonTranslationFunctions.c:56:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] commonTranslationFunctions.c:61:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:306:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:314:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:436:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:445:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:637:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:686:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:723:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:731:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:739:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:746:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:753:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:760:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:869:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:905:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:927:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:939:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:956:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:983:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:1018:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:1040:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:1075:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:1130:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:1281:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:1556:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pattern.c:935:6: warning: this statement may fall through [-Wimplicit-fallthrough=] pattern.c:1246:24: warning: this statement may fall through [-Wimplicit-fallthrough=] pattern.c:949:1: warning: 'pattern_insert_alternate' defined but not used [-Wunused-function] pattern.c:465:1: warning: 'pattern_print' defined but not used [-Wunused-function] pattern.c:344:1: warning: 'pattern_output' defined but not used [-Wunused-function] logging.c:76:30: warning: unused parameter 'level' [-Wunused-parameter] brl_checks.c:374:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] lou_debug.c:102:9: warning: pointer targets in return differ in signedness [-Wpointer-sign] lou_trace.c:81:19: warning: comparison of unsigned expression
so my change to selectively disable some warnings using the -Wno-foo
doesn't work on mingw and causes the build to fail. I guess the mingw on travis uses a very old gcc.
So we would have to write some workarounds to treat the mingw build differently.
TBH, I'm not sure if all of this is worth the trouble
Reverted 3597e72
For me it's definitely worth the trouble. Having to skim 132 warnings to check if there are new ones every time you change some code is just not workable. Doesn't this just require a little ifdef in the Makefile.am? Doesn't sound like a lot of trouble.
With clang and https://github.com/liblouis/liblouis/pull/566 I'm getting only 34 warnings:
List or warnings
compileTranslationTable.c:1020:13: warning: comparison of unsigned enum expression
Hm, is that good news or bad news?
AFAIK the warnings module defines a set of warnings and then checks if the compiler supports them. I guess before we had -Wall
and the actual meaning of that was defined by the compiler. That would explain why you had many more warnings.
With #566 the set of warnings is hard coded in gnulib/m4/manywarnings.m4
I was not attached to those other warnings so it's not bad :)
I just find it a bit strange that before I got tons of -Wsign-compare
warnings whereas now I get only one. If I would have gotten none I could understand, than that would be because the manywarnings module didn't enable it. But now...
Anyway, I don't need to fully understand. The important thing is that with #566 we can now selectively disable warnings.
I don't know why I said before that I only got 34 warnings with #566. I tried it again and I'm getting 391! This is at commit edcc09a. When I checkout the latest commit f2bb9f8 of #566 I only get 182, so you indeed managed to fix a lot of them. How many warnings have you got left?
List of warnings
compileTranslationTable.c:247:22: warning: comparison of integers of different signs: 'widechar' (aka 'unsigned int') and 'int' [-Wsign-compare] compileTranslationTable.c:269:36: warning: format string is not a string literal [-Wformat-nonliteral] compileTranslationTable.c:286:36: warning: format string is not a string literal [-Wformat-nonliteral] compileTranslationTable.c:984:21: warning: comparison of integers of different signs: 'const widechar' (aka 'const unsigned int') and 'short' [-Wsign-compare] compileTranslationTable.c:1020:13: warning: comparison of unsigned enum expression = 0 is always true [-Wtautological-compare] compileTranslationTable.c:1650:24: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:1712:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:1726:22: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2048:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2050:9: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2129:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2304:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2369:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2417:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2547:22: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2549:22: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2569:21: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2714:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2716:8: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2781:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2783:8: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2786:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2815:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2823:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:2875:16: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:2917:16: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:2931:17: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:2933:9: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] compileTranslationTable.c:3006:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3010:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3049:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3051:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3401:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3497:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3618:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3630:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3641:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3697:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3715:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3734:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3761:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3780:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3798:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3819:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3828:41: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3841:18: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3921:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3950:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:3952:17: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:4030:28: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:4334:23: warning: assigning to 'char *' from 'const char [2]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] compileTranslationTable.c:4537:16: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] compileTranslationTable.c:4904:15: warning: initializing 'char *' with an expression of type 'const char [6]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] lou_translateString.c:309:25: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_translateString.c:323:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:341:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:526:9: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_translateString.c:544:19: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:560:10: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:688:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:711:9: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:826:57: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] lou_translateString.c:828:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_translateString.c:1289:4: warning: cast from 'const TranslationTableOffset *' (aka 'const unsigned int *') to 'HyphenationState *' increases required alignment from 4 to 8 [-Wcast-align] lou_translateString.c:1320:19: warning: comparison of integers of different signs: 'int' and 'widechar' (aka 'unsigned int') [-Wsign-compare] lou_translateString.c:3650:77: warning: unused parameter 'mode' [-Wunused-parameter] lou_backTranslateString.c:1249:25: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_backTranslateString.c:1264:26: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] lou_backTranslateString.c:1275:16: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_backTranslateString.c:1322:44: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] lou_backTranslateString.c:1401:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_backTranslateString.c:1415:9: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] lou_backTranslateString.c:1506:47: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] lou_backTranslateString.c:1507:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:41:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:46:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:51:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:56:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] commonTranslationFunctions.c:61:44: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] metadata.c:173:15: warning: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] metadata.c:446:14: warning: declaration shadows a local variable [-Wshadow] pattern.c:306:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:314:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:436:19: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:445:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:637:22: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:686:22: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:723:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:731:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:739:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:746:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:753:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:760:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:869:48: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:905:48: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:927:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:939:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:956:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:983:20: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1018:20: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1040:21: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1075:22: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1130:23: warning: comparison of integers of different signs: 'unsigned int' and 'const int' [-Wsign-compare] pattern.c:1281:18: warning: comparison of integers of different signs: 'widechar' (aka 'unsigned int') and 'const int' [-Wsign-compare] pattern.c:1556:18: warning: comparison of integers of different signs: 'int' and 'const widechar' (aka 'const unsigned int') [-Wsign-compare] pattern.c:344:1: warning: unused function 'pattern_output' [-Wunused-function] pattern.c:465:1: warning: unused function 'pattern_print' [-Wunused-function] pattern.c:949:1: warning: unused function 'pattern_insert_alternate' [-Wunused-function] logging.c:51:16: warning: assigning to 'char *' from 'const char [8]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] logging.c:53:16: warning: assigning to 'char *' from 'const char [8]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] logging.c:57:19: warning: format string is not a string literal [-Wformat-nonliteral] logging.c:76:30: warning: unused parameter 'level' [-Wunused-parameter] logging.c:108:25: warning: format string is not a string literal [-Wformat-nonliteral] logging.c:112:26: warning: format string is not a string literal [-Wformat-nonliteral] logging.c:148:20: warning: format string is not a string literal [-Wformat-nonliteral] maketable.c:29:1: warning: no previous prototype for function 'loadTable' [-Wmissing-prototypes] maketable.c:34:1: warning: no previous prototype for function 'hyphenationEnabled' [-Wmissing-prototypes] maketable.c:39:1: warning: no previous prototype for function 'isLetter' [-Wmissing-prototypes] maketable.c:54:1: warning: no previous prototype for function 'toLowercase' [-Wmissing-prototypes] maketable.c:69:1: warning: no previous prototype for function 'toDotPattern' [-Wmissing-prototypes] maketable.c:82:1: warning: no previous prototype for function 'printRule' [-Wmissing-prototypes] maketable.c:365:1: warning: no previous prototype for function 'suggestChunks' [-Wmissing-prototypes] maketable.c:380:1: warning: no previous prototype for function 'findRelevantRules' [-Wmissing-prototypes] error.c:390:12: warning: data argument not used by format string [-Wformat-extra-args] brl_checks.c:374:23: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare] brl_checks.c:34:1: warning: unused function 'print_int_array' [-Wunused-function] lou_debug.c:102:9: warning: returning 'gl_uint8_t [256]' from a function with result type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign] lou_debug.c:308:28: warning: format string is not a string literal [-Wformat-nonliteral] lou_trace.c:81:19: warning: comparison of unsigned expression
24 matches for "warning: " in buffer: *compilation*
412:compileTranslationTable.c:1629:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
416:compileTranslationTable.c:3868:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
422:compileTranslationTable.c:3969:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
433:lou_translateString.c:3694:77: warning: unused parameter ‘mode’ [-Wunused-parameter]
437:lou_translateString.c:834:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
444:lou_translateString.c:3496:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
451:lou_translateString.c:2017:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
457:lou_translateString.c:2050:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
464:lou_translateString.c:303:3: warning: ‘transOpcode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
470:lou_translateString.c:1249:36: warning: ‘posMapping3’ may be used uninitialized in this function [-Wmaybe-uninitialized]
473:lou_translateString.c:1020:9: warning: ‘passPosMapping’ may be used uninitialized in this function [-Wmaybe-uninitialized]
488:lou_backTranslateString.c:633:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
495:lou_backTranslateString.c:517:6: warning: ‘multindRule’ may be used uninitialized in this function [-Wmaybe-uninitialized]
503:lou_backTranslateString.c:209:39: warning: ‘src’ may be used uninitialized in this function [-Wmaybe-uninitialized]
519:pattern.c:937:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
526:pattern.c:1248:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
533:pattern.c:951:1: warning: ‘pattern_insert_alternate’ defined but not used [-Wunused-function]
536:pattern.c:465:1: warning: ‘pattern_print’ defined but not used [-Wunused-function]
539:pattern.c:344:1: warning: ‘pattern_output’ defined but not used [-Wunused-function]
547:logging.c:76:30: warning: unused parameter ‘level’ [-Wunused-parameter]
1120:brl_checks.c:374:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
1146:lou_debug.c:102:9: warning: pointer targets in return differ in signedness [-Wpointer-sign]
1158:lou_trace.c:81:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
1162:lou_trace.c:101:9: warning: pointer targets in return differ in signedness [-Wpointer-sign]
@bertfrees sorry, the list above is from the master branch. The feature/selective_warnings
branch has the following errors:
124 warnings
124 matches for "warning: " in buffer: *compilation* 423:compileTranslationTable.c:181:3: warning: switch missing default case [-Wswitch-default] 427:compileTranslationTable.c:1628:23: warning: comparison is always true due to limited range of data type [-Wtype-limits] 431:compileTranslationTable.c:3411:6: warning: switch missing default case [-Wswitch-default] 434:compileTranslationTable.c:3664:3: warning: switch missing default case [-Wswitch-default] 438:compileTranslationTable.c:4334:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 443:config.h:685:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 450:compileTranslationTable.c:3867:23: warning: this statement may fall through [-Wimplicit-fallthrough=] 456:compileTranslationTable.c:3968:6: warning: this statement may fall through [-Wimplicit-fallthrough=] 463:compileTranslationTable.c:618:7: warning: this statement may fall through [-Wimplicit-fallthrough=] 474:lou_translateString.c:219:5: warning: switch missing default case [-Wswitch-default] 478:lou_translateString.c:1132:2: warning: missing initializer for field ‘length’ of ‘OutString {aka struct}’ [-Wmissing-field-initializers] 484:lou_translateString.c:1177:4: warning: missing initializer for field ‘length’ of ‘OutString {aka struct }’ [-Wmissing-field-initializers] 491:lou_translateString.c:1685:4: warning: switch missing default case [-Wswitch-default] 495:lou_translateString.c:1845:3: warning: switch missing default case [-Wswitch-default] 499:lou_translateString.c:2350:4: warning: switch missing default case [-Wswitch-default] 503:lou_translateString.c:3650:77: warning: unused parameter ‘mode’ [-Wunused-parameter] 507:lou_translateString.c:759:8: warning: this statement may fall through [-Wimplicit-fallthrough=] 514:lou_translateString.c:3447:7: warning: this statement may fall through [-Wimplicit-fallthrough=] 521:lou_translateString.c:1925:20: warning: this statement may fall through [-Wimplicit-fallthrough=] 527:lou_translateString.c:1960:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 535:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 539:lou_translateString.c:1402:5: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] 542:lou_translateString.c:3257:6: warning: ‘repwordLength’ may be used uninitialized in this function [-Wmaybe-uninitialized] 545:lou_translateString.c:3256:18: warning: ‘repwordStart’ may be used uninitialized in this function [-Wmaybe-uninitialized] 548:lou_translateString.c:3240:6: warning: ‘transCharslen’ may be used uninitialized in this function [-Wmaybe-uninitialized] 551:lou_translateString.c:3295:8: warning: ‘transOpcode’ may be used uninitialized in this function [-Wmaybe-uninitialized] 561:lou_translateString.c:229:9: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] 564:lou_translateString.c:261:3: warning: ‘transOpcode’ may be used uninitialized in this function [-Wmaybe-uninitialized] 570:lou_translateString.c:1167:36: warning: ‘posMapping3’ may be used uninitialized in this function [-Wmaybe-uninitialized] 573:lou_translateString.c:939:9: warning: ‘passPosMapping’ may be used uninitialized in this function [-Wmaybe-uninitialized] 585:lou_translateString.c:1177:11: warning: ‘passbuf2’ may be used uninitialized in this function [-Wmaybe-uninitialized] 589:lou_translateString.c:3611:2: warning: missed loop optimization, the loop counter may overflow [-Wunsafe-loop-optimizations] 593:lou_translateString.c:48:0: warning: macro "WORD_STOP" is not used [-Wunused-macros] 601:lou_backTranslateString.c:521:3: warning: switch missing default case [-Wswitch-default] 605:lou_backTranslateString.c:952:5: warning: switch missing default case [-Wswitch-default] 609:lou_backTranslateString.c:633:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 617:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 621:lou_backTranslateString.c:533:7: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] 624:lou_backTranslateString.c:962:9: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] 627:lou_backTranslateString.c:517:6: warning: ‘multindRule’ may be used uninitialized in this function [-Wmaybe-uninitialized] 635:lou_backTranslateString.c:209:39: warning: ‘src’ may be used uninitialized in this function [-Wmaybe-uninitialized] 643:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 651:metadata.c:173:21: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 655:metadata.c:325:5: warning: jump skips variable initialization [-Wjump-misses-init] 664:metadata.c:332:6: warning: jump skips variable initialization [-Wjump-misses-init] 673:metadata.c:344:4: warning: jump skips variable initialization [-Wjump-misses-init] 683:metadata.c:446:14: warning: declaration of ‘k’ shadows a previous local [-Wshadow] 691:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 695:metadata.c:466:12: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] 698:metadata.c:466:12: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] 704:pattern.c:358:3: warning: switch missing default case [-Wswitch-default] 708:pattern.c:1240:2: warning: switch missing default case [-Wswitch-default] 712:pattern.c:1344:42: warning: logical ‘and’ of equal expressions [-Wlogical-op] 715:pattern.c:1366:4: warning: switch missing default case [-Wswitch-default] 719:pattern.c:935:6: warning: this statement may fall through [-Wimplicit-fallthrough=] 726:pattern.c:1246:24: warning: this statement may fall through [-Wimplicit-fallthrough=] 733:pattern.c:949:1: warning: ‘pattern_insert_alternate’ defined but not used [-Wunused-function] 736:pattern.c:465:1: warning: ‘pattern_print’ defined but not used [-Wunused-function] 739:pattern.c:344:1: warning: ‘pattern_output’ defined but not used [-Wunused-function] 743:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 746:pattern.c:142:0: warning: macro "EXPR_DATA_2" is not used [-Wunused-macros] 749:pattern.c:133:0: warning: macro "EXPR_DATA_2_IN" is not used [-Wunused-macros] 757:logging.c:51:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 760:logging.c:53:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 763:logging.c:57:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] 767:logging.c:76:30: warning: unused parameter ‘level’ [-Wunused-parameter] 772:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 783:maketable.c:29:1: warning: no previous prototype for ‘loadTable’ [-Wmissing-prototypes] 786:maketable.c:34:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes] 790:maketable.c:34:1: warning: old-style function definition [-Wold-style-definition] 792:maketable.c:39:1: warning: no previous prototype for ‘isLetter’ [-Wmissing-prototypes] 795:maketable.c:54:1: warning: no previous prototype for ‘toLowercase’ [-Wmissing-prototypes] 798:maketable.c:69:1: warning: no previous prototype for ‘toDotPattern’ [-Wmissing-prototypes] 801:maketable.c:82:1: warning: no previous prototype for ‘printRule’ [-Wmissing-prototypes] 805:maketable.c:160:3: warning: switch missing default case [-Wswitch-default] 808:maketable.c:237:5: warning: jump skips variable initialization [-Wjump-misses-init] 817:maketable.c:241:6: warning: jump skips variable initialization [-Wjump-misses-init] 826:maketable.c:191:51: warning: jump skips variable initialization [-Wjump-misses-init] 835:maketable.c:192:35: warning: jump skips variable initialization [-Wjump-misses-init] 844:maketable.c:196:5: warning: jump skips variable initialization [-Wjump-misses-init] 853:maketable.c:199:5: warning: jump skips variable initialization [-Wjump-misses-init] 862:maketable.c:202:5: warning: jump skips variable initialization [-Wjump-misses-init] 871:maketable.c:205:5: warning: jump skips variable initialization [-Wjump-misses-init] 880:maketable.c:208:5: warning: jump skips variable initialization [-Wjump-misses-init] 889:maketable.c:211:5: warning: jump skips variable initialization [-Wjump-misses-init] 898:maketable.c:214:5: warning: jump skips variable initialization [-Wjump-misses-init] 907:maketable.c:217:5: warning: jump skips variable initialization [-Wjump-misses-init] 916:maketable.c:227:5: warning: jump skips variable initialization [-Wjump-misses-init] 925:maketable.c:230:40: warning: jump skips variable initialization [-Wjump-misses-init] 935:maketable.c:365:1: warning: no previous prototype for ‘suggestChunks’ [-Wmissing-prototypes] 938:maketable.c:380:1: warning: no previous prototype for ‘findRelevantRules’ [-Wmissing-prototypes] 942:maketable.c:398:4: warning: switch missing default case [-Wswitch-default] 947:internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1523:brl_checks.c:374:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] 1526:brl_checks.c:337:3: warning: jump skips variable initialization [-Wjump-misses-init] 1535:brl_checks.c:337:3: warning: jump skips variable initialization [-Wjump-misses-init] 1544:brl_checks.c:344:3: warning: jump skips variable initialization [-Wjump-misses-init] 1553:brl_checks.c:344:3: warning: jump skips variable initialization [-Wjump-misses-init] 1562:brl_checks.c:349:3: warning: jump skips variable initialization [-Wjump-misses-init] 1571:brl_checks.c:349:3: warning: jump skips variable initialization [-Wjump-misses-init] 1581:brl_checks.c:34:1: warning: ‘print_int_array’ defined but not used [-Wunused-function] 1585:../liblouis/internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1599:../liblouis/internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1607:../liblouis/internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1615:../liblouis/internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1623:lou_debug.c:102:9: warning: pointer targets in return differ in signedness [-Wpointer-sign] 1627:lou_debug.c:308:4: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] 1632:../liblouis/internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1640:../liblouis/internal.h:90:28: warning: ‘dotMapping’ defined but not used [-Wunused-const-variable=] 1648:lou_trace.c:81:19: warning: comparison of unsigned expression
OK. Still looks like you get mostly different warnings than me.
I'm removing this from the milestone because I just never get to it.