1

I cannot inline suppress obsoleteFunctiosgets warning from cppcheck. I tried:

// cppcheck-suppress obsoleteFunctionsgets

with no success.

Did any of you experience this warning? Any hint? Thanks.

orbitcowboy
  • 1,438
  • 13
  • 25
miguel azevedo
  • 537
  • 1
  • 4
  • 5

1 Answers1

2

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 prefer to use --suppress or --suppressions-list instead of --inline-suppr. I don't like to clutter my code with such comments.

Daniel Marjamäki
  • 2,907
  • 15
  • 16