[PATCH] D153163: Add __attribute__((warn_unused_result)) to LLVMErrorRef
Aaron Ballman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 21 05:49:54 PDT 2023
aaron.ballman 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
----------------
dblaikie wrote:
> 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.
Ah good point, it's not allowed on typedefs there either. Neeeevermind. :-)
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