Hi Guys,
I'm getting error id "obsoleteFunctionsgets" on my code and for several reasons I don't want to change it to fgets as it is suggested.
I ran cppcheck and on the xml logfile i got "obsoleteFunctionsgets".
I tried to inline suppress this error with:
// cppcheck-suppress obsoleteFunctionsgets
with no success.
Any hint?
thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Use --inline-suppr on the command line also. Otherwise the comment is ignored.
daniel@dator:~/cppcheck$ ./cppcheck --enable=all 1.c
Checking 1.c... [1.c:4]: (style) Obsolete function 'gets' called. It is recommended to use the function 'fgets' instead.
daniel@dator:~/cppcheck$ ./cppcheck --enable=all --inline-suppr 1.c
Checking 1.c...
daniel@dator:~/cppcheck$
Personally.. I use --suppress or --suppressions-list instead of --inline-suppr. I don't like to clutter my code with such comments.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Guys,
I'm getting error id "obsoleteFunctionsgets" on my code and for several reasons I don't want to change it to fgets as it is suggested.
I ran cppcheck and on the xml logfile i got "obsoleteFunctionsgets".
I tried to inline suppress this error with:
// cppcheck-suppress obsoleteFunctionsgets
with no success.
Any hint?
thanks.
Use --inline-suppr on the command line also. Otherwise the comment is ignored.
daniel@dator:~/cppcheck$ ./cppcheck --enable=all 1.c
Checking 1.c...
[1.c:4]: (style) Obsolete function 'gets' called. It is recommended to use the function 'fgets' instead.
daniel@dator:~/cppcheck$ ./cppcheck --enable=all --inline-suppr 1.c
Checking 1.c...
daniel@dator:~/cppcheck$
Personally.. I use --suppress or --suppressions-list instead of --inline-suppr. I don't like to clutter my code with such comments.
Hi ... using the inline suppression approach, is there any way to supress all cppchecks for that line? eg, something like:
Last edit: Darren Smith 2014-12-17
Try:
worked, thanks