[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#687564: RFS: irstlm/5.80.01-1 -- [ITP] IRST Language Modeling Toolkit



Il 04/01/2013 15:26, Jakub Wilk ha scritto:
> * Giulio Paci <giuliopaci@gmail.com>, 2013-01-01, 23:54:
> I see some warnings in the build log. I haven't look into details, but at least breaking aliasing rules is undefined behavior, and therefore it must be fixed.
> 
> lmtable.cpp:726:30: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
> lmtable.cpp:1614:21: warning: variable 'hit' set but not used [-Wunused-but-set-variable]
> lmtable.cpp:1735:32: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
> lmtable.cpp:2272:10: warning: variable 'tlk' set but not used [-Wunused-but-set-variable]
> lmtable.cpp:1550:30: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:1450:33: warning: ignoring return value of 'int ftruncate(int, __off64_t)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:1416:14: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:1421:14: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:785:33: warning: ignoring return value of 'int ftruncate(int, __off64_t)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:513:39: warning: ignoring return value of 'int ftruncate(int, __off64_t)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:616:14: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:620:14: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> lmtable.cpp:624:14: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> lmInterpolation.cpp:168:17: warning: converting 'false' to pointer type 'bool*' [-Wconversion-null]
> lmInterpolation.cpp:95:37: warning: array subscript is above array bounds [-Warray-bounds]
> ngramtable.h:671:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
> util.cpp:70:18: warning: ignoring return value of 'int mkstemp(char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1518:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1674:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1329:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1510:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1145:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1194:19: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1041:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:729:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:886:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> mdiadapt.cpp:1002:17: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> n_gram.h:73:39: warning: assuming signed overflow does not occur when assuming that (X - c) <= X is always true [-Wstrict-overflow]
> shiftlm.cpp:538:11: warning: variable 'history' set but not used [-Wunused-but-set-variable]
> cplsa.cpp:285:10: warning: variable 'lastLL' set but not used [-Wunused-but-set-variable]
> cplsa.cpp:365:18: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> compile-lm.cpp:183:16: warning: variable 'outtype' set but not used [-Wunused-but-set-variable]
> quantize-lm.cpp:95:6: warning: unused parameter 'argc' [-Wunused-parameter]
> quantize-lm.cpp:95:6: warning: unused parameter 'argv' [-Wunused-parameter]
> quantize-lm.cpp:95:6: warning: unused parameter 'argi' [-Wunused-parameter]
> tlm.cpp:516:34: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> tlm.cpp:530:30: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> plsa.cpp:233:23: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
> plsa.cpp:252:53: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]

I fixed some of these warnings. I did not fix:
1) warning: ignoring return value of '...', declared with attribute warn_unused_result [-Wunused-result]
2) warning: unused parameter '...' [-Wunused-parameter]
3) lmInterpolation.cpp:168:17: warning: converting 'false' to pointer type 'bool*' [-Wconversion-null]
4) lmInterpolation.cpp:95:37: warning: array subscript is above array bounds [-Warray-bounds]

The code generating warning 3 seems wrong, but I was not sure about the implications of fixing it. So I asked upstream, but I did not yet receive a feedback on it.

In addition to this, I improved a little bit the irstlm script, by removing some bashism, and I implemented a bash completion file for it.

Bests,
	Giulio.


Reply to: