jbenden / vscode-c-cpp-flylint

A VS Code extension for advanced, modern, static analysis of C/C++ that supports a number of back-end analyzer programs.
MIT License
152 stars 29 forks source link

Unexpected warning in hpp file. #198

Open upizpp opened 1 year ago

upizpp commented 1 year ago

As far as I know, files with the extension of hpp should also belong to the type of Header file, rather than source code files with the extension of cpp. Therefore, I think using '# pragma once' in HPP files is allowed, but this extension gave me a warning.

pragma once in main file [-Wpragma-once-outside-header]

gregersn commented 1 year ago

I have my include files in a separate folder, and added

  "c-cpp-flylint.excludeFromWorkspacePaths": [
    "include"
  ],

as a workaround, to avoid cppcheck getting passed the include files.

Not sure if it is ideal.