[LTP] 回复: [PATCH 1/3] link03: Convert docs to docparse

Yang Xu (Fujitsu) xuyang2018.jy@fujitsu.com
Thu Oct 26 09:37:34 CEST 2023


Hi Petr,

>Hi Xu,

>Also, while you are at it, could you please fix these warnings?

OK. I will pay attention to it.

>$ make link03

>link03.c: In function ‘main’:
>link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
> 104 |    sprintf(lname, "%s%d", fname, i);
>     |                      ^~
>link03.c:104:19: note: directive argument in the range [1, 2147483646]
>  104 |    sprintf(lname, "%s%d", fname, i);
>     |                   ^~~~~~
>link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  104 |    sprintf(lname, "%s%d", fname, i);
>     |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>  123 |    sprintf(lname, "%s%d", fname, i);
>     |                      ^~
>link03.c:123:19: note: directive argument in the range [1, 2147483646]
>  123 |    sprintf(lname, "%s%d", fname, i);
>      |                   ^~~~~~
>link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  123 |    sprintf(lname, "%s%d", fname, i);
>      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>  138 |    sprintf(lname, "%s%d", fname, i);
>      |                      ^~
>link03.c:138:19: note: directive argument in the range [1, 2147483646]
>  138 |    sprintf(lname, "%s%d", fname, i);
>      |                   ^~~~~~
>link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  138 |    sprintf(lname, "%s%d", fname, i);

>$ make check-link03
>CHECK testcases/kernel/syscalls/link/link03.c
>link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
>link03.c:33: ERROR: do not initialise statics to 0
>link03.c:55: ERROR: code indent should use tabs where possible
>link03.c:90: ERROR: code indent should use tabs where possible
>link03.c:100: ERROR: code indent should use tabs where possible

>Thanks!

>Kind regards,
>Petr

Best Regards
Yang Xu


More information about the ltp mailing list