[PATCH] D102168: Use an allow list on reserved macro identifiers

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 10 08:16:53 PDT 2021


aaron.ballman added a comment.

Some additional ones to allow from MSDN: `_CRT_SECURE_NO_WARNINGS`, `_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES`, `_CRT_NONSTDC_NO_WARNINGS`,  (https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160).



================
Comment at: clang/lib/Lex/PPDirectives.cpp:125
+  if (II->isReserved(Lang) != ReservedIdentifierStatus::NotReserved) {
+    static constexpr std::array<StringRef, 16> ReservedMacro = {
+        "_ATFILE_SOURCE",       "_BSD_SOURCE",    "_FILE_OFFSET_BITS",
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102168/new/

https://reviews.llvm.org/D102168



More information about the cfe-commits mailing list