编译器警告
Closed this issue · 0 comments
qingtian110 commented
大佬,有办法修复编译过程中的编译器警告吗?虽然不影响 ko 的编译,但是如果能解决这些警告看着舒服很多
kernel :5.10.110
gcc: gcc11.2.0
~/kmod/oaf/af_utils.c: In function 'k_vsscanf':
~/kmod/oaf/af_utils.c:209:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
209 | base = 0;
| ~~~~~^~~
~/kmod/oaf/af_utils.c:210:17: note: here
210 | case 'd':
| ^~~~
~/kmod/oaf/cJSON.c: In function 'parse_string':
~/kmod/oaf/cJSON.c:173:91: warning: this statement may fall through [-Wimplicit-fallthrough=]
173 | case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
| ~~~^~~~~
~/kmod/oaf/cJSON.c:174:49: note: here
174 | case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
| ^~~~
~/kmod/oaf/cJSON.c:174:91: warning: this statement may fall through [-Wimplicit-fallthrough=]
174 | case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
| ~~~^~~~~
~/kmod/oaf/cJSON.c:175:49: note: here
175 | case 1: *--ptr2 =(uc | firstByteMark[len]);
| ^~~~
~/kmod/oaf/regexp.c:223:58: warning: missing braces around initializer [-Wmissing-braces]
223 | static int (*matchfun[TYPENUM][2])(RE *, RE *, char *) = {
| ^
224 | 0, 0, 0, 0, 0, 0, 0, 0,
| { } { } { } { }
225 | matchstar, matchstar_l,
| { }
226 | matchplus, matchplus_l,
| { }
227 | matchques, matchques,
| {
228 | };
| }
~/kmod/oaf/regexp.c: In function 'regexp_match':
~/kmod/oaf/regexp.c:264:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
264 | if(ret = matchhere(regexp, text))
| ^~~
~/kmod/oaf/app_filter.c: In function 'load_feature_buf_from_file':
~/kmod/oaf/app_filter.c:238:23: warning: unused variable 'fs' [-Wunused-variable]
238 | mm_segment_t fs;
|