Skip to content

misc-include-cleaner false positive #190831

@herbanonymous

Description

@herbanonymous
> clang-tidy -checks='*,-llvmlibc-restrict-system-libc-headers,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-altera-unroll-loops,-concurrency-mt-unsafe,-altera-id-dependent-backward-branch,-readability-function-cognitive-complexity,-*-magic-numbers,-cppcoreguidelines-avoid-non-const-global-variables' vector.c
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "vector.c"
No compilation database found in /u/talib or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
3771 warnings generated.
/u/talib/vector.c:7:1: warning: included header getopt.h is not used directly [misc-include-cleaner]
    7 | #include <getopt.h>
      | ^~~~~~~~~~~~~~~~~~~
    8 | #include <libgen.h>
/u/talib/vector.c:56:23: warning: no header providing "getopt" is directly included [misc-include-cleaner]
    4 |         while ((opt = getopt(argc, argv, OPTIONS)) != -1) {
      |                       ^
/u/talib/vector.c:59:35: warning: no header providing "optarg" is directly included [misc-include-cleaner]
   59 |                     ifile = fopen(optarg, "re");
      |                                   ^
Suppressed 3768 warnings (3768 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions