<i>Add IWYU export pragma annotations for improved clangd and clang-tidy diagnostics</i>.
by
.
D 2025-10-24T16:16:13.659
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-plain
J comment Someone\sincluding\sthe\stoplevel\s"tcl.h"\sheader\smight\sget\smisc-include-cleaner\swarnings\sfrom\sthe\sclangd\slanguage\sserver\sand\sclang-tidy\sin\stheir\sprojects\sfor\ssome\ssymbols\sthat\sare\sonly\sprovided\sby\sthe\s"tclDecls.h"\sor\s"tclPlatDecls.h"\sheaders\sas\sthey\sare\snot\s_directly_\sincluded.\r\n\s\r\nThe\sannotation\swith\sIWYU\spragmas\sfixes\sthat\sand\stells\sthe\stools\sthat\sit\sshould\sconsider\sthat\sthese\sincludes\sindeed\sshould\sbe\sconsidered\sas\sexporting\sthe\ssymbols\sand\sthus\sas\sif\sthey\sdirectly\sprovided\sthe\ssymbol\r\n\r\nDocumentation\sclangd\sand\sclang-tidy\r\nhttps://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html\spoints\sto\shttps://clangd.llvm.org/design/include-cleaner#iwyu-pragmas\r\n\r\nThis\shas\sbeen\sfirst\simplemented\sand\sdocuemnted\sin\sthe\sinclude-what-you-use\sproject\shttps://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-begin_exportsend_exports\r\n\r\n===\s8<\s===\sPatch\s====\r\n\r\n---\sa/generic/tcl.h\r\n+++\sb/generic/tcl.h\r\n@@\s-2343,7\s+2343,7\s@@\sEXTERN\sconst\schar\s*TclZipfs_AppHook(int\s*argc,\schar\s***argv);\r\n\s\s*\stable.\r\n\s\s*/\r\n\s\r\n-#include\s"tclDecls.h"\r\n+#include\s"tclDecls.h"\s\s/*\sIWYU\spragma:\sexport\s*/\r\n\s\r\n\s/*\r\n\s\s*\sInclude\splatform\sspecific\spublic\sfunction\sdeclarations\sthat\sare\saccessible\r\n@@\s-2356,7\s+2356,7\s@@\sEXTERN\sconst\schar\s*TclZipfs_AppHook(int\s*argc,\schar\s***argv);\r\n\s#\s\s\sdefine\sTCLAPI\sMODULE_SCOPE\r\n\s#endif\r\n\s\r\n-#include\s"tclPlatDecls.h"\r\n+#include\s"tclPlatDecls.h"\s\s/*\sIWYU\spragma:\sexport\s*/\r\n\s\r\n\s/*\r\n\s\s*----------------------------------------------------------------------------
J foundin head
J is_private 0
J login hzeller
J priority 5\sMedium
J private_contact 9bef9914fb30c8aedb6cfa0bafc4b43d058d4e85
J resolution None
J severity Minor
J status Open
J submitter hzeller
J subsystem None
J title Add\sIWYU\sexport\spragma\sannotations\sfor\simproved\sclangd\sand\sclang-tidy\sdiagnostics
J type Patch
K c7dc599e73a7094298594c4383ad3524f009e6f8
U hzeller
Z a039a6fe4ba678246b59620e6175dd7b