tmp.c:3:25: style: Parameter 'argv' can be declared as const array [constParameter]
int main(int argc,char *argv[])
^
This is a tiny issue, but I think Cppcheck might exclude standardised fucntions (like main()) from constParameter check automatically.
Best Regards Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right, const argv pointer works on both Linux and Windows. However this change makes definition of main different than declaration (which is implicit).
Lets hope it is harmless :-)
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
for following program:
Cppcheck 2.11 says:
This is a tiny issue, but I think Cppcheck might exclude standardised fucntions (like main()) from constParameter check automatically.
Best Regards Martin
Since
argv
is only read from, it can be declared asconst
. This is accepted in C and C++.You are right, const argv pointer works on both Linux and Windows. However this change makes definition of main different than declaration (which is implicit).
Lets hope it is harmless :-)
Martin