I found a lot of things to customize in flycheck, but not one that would enable passing down --library=posix option to cppcheck.

  • I can of course write a wrapper for cppcheck which injects that option, and point the cppcheck executable to the wrapper, but that would feel like a dirty hack. Jul 13 at 13:13
  • If none internal variables in flycheck specify what you need, maybe try some of them - e.g. flycheck-cppcheck-standards in the form "--std=posix", "--library-posix".
    – Ian
    Jul 14 at 5:58
  • The flycheck-cppcheck-standards seems to be a list of C/C++ standards, e.g. (setq flycheck-cppcheck-standards '("c++20")) and will end up as the cppcheck --std= arguments, whereas the posixfor the --library= means the POSIX standard C APIs, as opposed to the builtin setting for library which only includes the C standard APIs. Jul 14 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.