Skip to content
Tcl Source Code History Of Ticket c7dc599e73
Login

History Of Ticket c7dc599e73

Artifacts Associated With Ticket c7dc599e73

  1. Ticket change [6654efac69] (rid 247492) by hzeller on 2025-10-24 16:16:13:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      Someone including the toplevel "tcl.h" header might get misc-include-cleaner warnings from the clangd language server and clang-tidy in their projects for some symbols that are only provided by the "tclDecls.h" or "tclPlatDecls.h" headers as they are not _directly_ included.
       
      The annotation with IWYU pragmas fixes that and tells the tools that it should consider that these includes indeed should be considered as exporting the symbols and thus as if they directly provided the symbol
      
      Documentation clangd and clang-tidy
      https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html points to https://clangd.llvm.org/design/include-cleaner#iwyu-pragmas
      
      This has been first implemented and docuemnted in the include-what-you-use project https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-begin_exportsend_exports
      
      === 8< === Patch ====
      
      --- a/generic/tcl.h
      +++ b/generic/tcl.h
      @@ -2343,7 +2343,7 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
        * table.
        */
       
      -#include "tclDecls.h"
      +#include "tclDecls.h"  /* IWYU pragma: export */
       
       /*
        * Include platform specific public function declarations that are accessible
      @@ -2356,7 +2356,7 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
       #   define TCLAPI MODULE_SCOPE
       #endif
       
      -#include "tclPlatDecls.h"
      +#include "tclPlatDecls.h"  /* IWYU pragma: export */
       
       /*
        *----------------------------------------------------------------------------
      
    5. foundin initialized to: "head"
    6. is_private initialized to: "0"
    7. login: "hzeller"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9bef9914fb30c8aedb6cfa0bafc4b43d058d4e85"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "hzeller"
    14. subsystem initialized to: "None"
    15. title initialized to:
      Add IWYU export pragma annotations for improved clangd and clang-tidy diagnostics
      
    16. type initialized to: "Patch"
  2. Ticket change [03a9d2ebcd] (rid 247658) by jan.nijtmans on 2025-10-28 10:50:02:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2460976.95141228"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Added now for all *Decls.h inclusions. Also done for itcl and tdbc.
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"