Ruby: include/ruby/internal/attr/diagnose_if.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

diagnose_if.h
Go to the documentation of this file.
1#ifndef RBIMPL_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ATTR_DIAGNOSE_IF_H
23#include "ruby/internal/has/attribute.h"
24#include "ruby/internal/warning_push.h"
25
27#if RBIMPL_COMPILER_BEFORE(Clang, 5, 0, 0)
28# /* https://bugs.llvm.org/show_bug.cgi?id=34319 */
29# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
30
31#elif RBIMPL_HAS_ATTRIBUTE(diagnose_if)
32# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) \
33 RBIMPL_WARNING_PUSH() \
34 RBIMPL_WARNING_IGNORED(-Wgcc-compat) \
35 __attribute__((__diagnose_if__(_, __, ___))) \
36 RBIMPL_WARNING_POP()
37
38#else
39# define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
40#endif
41
42#endif /* RBIMPL_ATTR_DIAGNOSE_IF_H */
attribute.h
Defines RBIMPL_HAS_ATTRIBUTE.
warning_push.h
Defines RBIMPL_WARNING_PUSH.