mirror of
https://github.com/curl/curl.git
synced 2026-06-01 22:14:17 +03:00
checksrc: ensure using ifdef/ifndef when possible, fix fallouts
Follow-up to 89771d19d5 #18018
Closes #20065
This commit is contained in:
parent
e8415a8296
commit
4ad87f2cb8
9 changed files with 30 additions and 11 deletions
|
|
@ -79,6 +79,13 @@ void startfunc(int a, int b) {
|
|||
if(sprintf(buffer, "%s", moo)) {}
|
||||
*buffer_len = (ssize_t)alsobad((char *)buffer, NULL, 16);
|
||||
|
||||
# if defined(SINGLE_MACRO)
|
||||
#if ! defined(__macro_10)
|
||||
#elif !defined(TESTMACRO)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// CPP comment ?
|
||||
|
||||
/* comment does not end
|
||||
|
|
@ -205,7 +212,13 @@ void startfunc(int a, int b) {
|
|||
./%LOGDIR/code1185.c:62:25: warning: use of alsobad is banned (BANNEDFUNC)
|
||||
*buffer_len = (ssize_t)alsobad((char *)buffer, NULL, 16);
|
||||
^
|
||||
./%LOGDIR/code1185.c:64:2: warning: // comment (CPPCOMMENTS)
|
||||
./%LOGDIR/code1185.c:64:1: warning: use ifdef/ifndef for single macro checks (IFDEFSINGLE)
|
||||
# if defined(SINGLE_MACRO)
|
||||
^
|
||||
./%LOGDIR/code1185.c:65:1: warning: use ifdef/ifndef for single macro checks (IFDEFSINGLE)
|
||||
#if ! defined(__macro_10)
|
||||
^
|
||||
./%LOGDIR/code1185.c:71:2: warning: // comment (CPPCOMMENTS)
|
||||
// CPP comment ?
|
||||
^
|
||||
./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT)
|
||||
|
|
@ -214,7 +227,7 @@ void startfunc(int a, int b) {
|
|||
./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT)
|
||||
%SP
|
||||
^
|
||||
checksrc: 0 errors and 42 warnings
|
||||
checksrc: 0 errors and 44 warnings
|
||||
</stdout>
|
||||
<errorcode>
|
||||
5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue