[PATCH] D107095: This patch adds `#pragma clang header_unsafe` to enable flagging macros as unsafe for header use. This is to allow macros that may have ABI implications to be avoided in headers that have ABI stability promises.
Chris Bieneman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 29 11:39:01 PDT 2021
beanz created this revision.
beanz added reviewers: aaron.ballman, rsmith, lgerbarg, pete.
Herald added a subscriber: dexonsmith.
beanz requested review of this revision.
Herald added a project: clang.
Using macros in headers (particularly public headers) can cause a
variety of issues relating to ABI and modules. This new pragma logs
warnings when using annotated macros outside the main source file.
This warning is added under a new diagnostics group -Wpedantic-macros.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107095
Files:
clang/docs/LanguageExtensions.rst
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/include/clang/Basic/IdentifierTable.h
clang/include/clang/Lex/Preprocessor.h
clang/lib/Lex/Pragma.cpp
clang/lib/Lex/Preprocessor.cpp
clang/test/Lexer/Inputs/unsafe-macro-2.h
clang/test/Lexer/Inputs/unsafe-macro.h
clang/test/Lexer/unsafe-macro.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107095.362839.patch
Type: text/x-patch
Size: 14163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210729/e2710a1d/attachment-0001.bin>
More information about the cfe-commits
mailing list