On 18/07/17 03:51, Christopher Li wrote: > This is the updated version of the selfcheck. > > Merge some change submit by Ramsay Jones. > I also fix some warning report by selfcheck. That is the 4th path. > > This is the current selfcheck warning on Linux: > > CHECK pre-process.c > pre-process.c:712:25: warning: Variable length array is used. > pre-process.c:2019:28: warning: Variable length array is used. I have the obvious fix for these, but it has potential performance problems (but, since I haven't done the timing tests, I don't know if it is a problem or not). ;-) Another option, of course, is to (like in git) add a 'SPARSE_FLAGS' so that we can set '-Wno-vla' when checking the 'pre-process.sc' file, something like: pre-process.sc: SPARSE_FLAGS += '-Wno-vla' %.sc: %.c sparse $(QUIET_CHECK) $(CHECKER) $(SPARSE_FLAGS) -c $(ALL_CFLAGS) $< ... or something like that. > CHECK symbol.c > CHECK lib.c > lib.c:194:6: error: symbol 'error_die' redeclared with different type > (originally declared at lib.h:98) - different modifiers > lib.c:203:6: error: symbol 'die' redeclared with different type > (originally declared at lib.h:94) - different modifiers > > This one is hard to fix. It is reporting the difference in NORETURN attribute. I have a fix (well, *workaround*) for these. I have to do the same in git. (*hush*, nobody has yet noticed that it is a sparse bug). ;-) Ignoring the 'memset byte count' warning, the only real warning left (but _only_ if you build with the NO_REGEX build variable set) is an example of this warning in the 'compat regex code'. Actually, that particular warning is about the use of the 'pure' attribute, but it is treated the same way as NORETURN. A simple test file: $ cat -n test.c 1 int func(int a) __attribute__ ((pure)); 2 3 __attribute__ ((pure)) 4 int func(int a) 5 { 6 return 0; 7 } $ $ cgcc -no-compile test.c test.c:4:5: error: symbol 'func' redeclared with different type (originally declared at test.c:1) - different modifiers $ I have been meaning to fix this up for years ... :-P > The NORETURN should not be a modifier, it is an attribute. > The other issue here is that, sparse haven't handle merging the > difference instance > of the incremental declare properly. Correct, something else I've been meaning to do. > > I also have this: > CHECK sparse-llvm.c > /usr/include/bits/mathinline.h:134:55: warning: obsolete struct > initializer, use C99 syntax > /usr/include/bits/mathinline.h:146:59: warning: obsolete struct > initializer, use C99 syntax > /usr/include/bits/mathinline.h:153:64: warning: obsolete struct > initializer, use C99 syntax > > That is a system header file which I can't fix in sparse. Hmm, I don't see these at all. In fact on my system (Linux Mint 18.2) that file is at '/usr/include/x86_64-linux-gnu/bits/mathinline.h'. (So you probably don't have multi-lib). ATB, Ramsay Jones -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html