[PATCH] D153163: Add __attribute__((warn_unused_result)) to LLVMErrorRef

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 13:31:31 PDT 2023


dblaikie added inline comments.


================
Comment at: llvm/include/llvm-c/ExternC.h:47-51
+#if LLVM_HAS_ATTRIBUTE(warn_unused_result) && defined(__clang__)
+#define LLVM_NODISCARD_GNU_STYLE_CLANG __attribute__((warn_unused_result))
+#else
+#define LLVM_NODISCARD_GNU_STYLE_CLANG
+#endif
----------------
aaron.ballman wrote:
> Hmm, worth it to add `__has_c_attribute(nodiscard)` as a branch, or given C2x's newness, not worth it?
Does C2x support the attribute on typedefs? (the C++ committee wasn't so enthusiastic about that change & I don't follow the C committee directly)

I'm happy enough to include C support, if it applies.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153163



More information about the llvm-commits mailing list