mirror of
https://github.com/curl/curl.git
synced 2026-07-31 12:48:09 +03:00
checksrc: catch banned functions when preceded by (
Also add a test case. Closes #18779
This commit is contained in:
parent
c478c7efdf
commit
684f4cdd3e
2 changed files with 10 additions and 3 deletions
|
|
@ -74,6 +74,8 @@ void startfunc(int a, int b) {
|
|||
|
||||
if(a) b++;
|
||||
|
||||
if(sprintf(buffer, "%s", moo)) {}
|
||||
|
||||
// CPP comment ?
|
||||
|
||||
/* comment doesn't end
|
||||
|
|
@ -192,7 +194,10 @@ void startfunc(int a, int b) {
|
|||
./%LOGDIR/code1185.c:57:7: warning: conditional block on the same line (ONELINECONDITION)
|
||||
if(a) b++;
|
||||
^
|
||||
./%LOGDIR/code1185.c:59:2: warning: // comment (CPPCOMMENTS)
|
||||
./%LOGDIR/code1185.c:59:5: warning: use of sprintf is banned (BANNEDFUNC)
|
||||
if(sprintf(buffer, "%s", moo)) {}
|
||||
^
|
||||
./%LOGDIR/code1185.c:61:2: warning: // comment (CPPCOMMENTS)
|
||||
// CPP comment ?
|
||||
^
|
||||
./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT)
|
||||
|
|
@ -201,7 +206,7 @@ void startfunc(int a, int b) {
|
|||
./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT)
|
||||
|
||||
^
|
||||
checksrc: 0 errors and 39 warnings
|
||||
checksrc: 0 errors and 40 warnings
|
||||
</stdout>
|
||||
<errorcode>
|
||||
5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue