"Included header ... is not used directly..."

Comments

1 comment

  • Avatar
    Jon Elliott

    The diagnostic warning comes from clangd. The warning indicates that the header file is not being used directly, i.e. there is nothing defined or declared in the header file that is being used by the module including it. This can happen when you include a header file to include another header file that is being used.

    A specific warning can be removed by appending a "IWYU pragma: keep" comment to the include. For example:

    #include "stm32l011xx.h" // IWYU pragma: keep

    The warnings can be disabled by putting the following text in a file named .clangd located in your source tree (clangd searches in all parent directories of the active file for this file):

    Diagnostics:
    UnusedIncludes: None

    There is more information on this at https://clangd.llvm.org/guides/include-cleaner

    0
    Comment actions Permalink

Please sign in to leave a comment.