[PATCH] D70285: Wrap C APIs with pragmas enforcing -Werror=strict-prototypes

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 15 11:52:29 PST 2019


aaron.ballman added inline comments.


================
Comment at: clang/include/clang-c/ExternC.h:18-19
+#define LLVM_CLANG_C_STRING_PROTOTYPES_BEGIN                                   \
+  _Pragma("clang diagnostic push")                                             \
+      _Pragma("clang diagnostic error \"-Wstrict-prototypes\"")
+#define LLVM_CLANG_C_STRING_PROTOTYPES_END _Pragma("clang diagnostic pop")
----------------
I think this needs some extra compiler guards, unfortunately. I don't think MSVC supports `_Pragma` (IIRC, they rather oddly decided to call it `__pragma` instead). Do we want to restrict this pragma to only clang compilers? Do we need to do something to support GCC as well?


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

https://reviews.llvm.org/D70285





More information about the cfe-commits mailing list