Skip to content
Snippets Groups Projects
Commit 3b350317 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[libc] avoid clang complains on unknown attributes when parsing libc

especially useful for frama-clang, but could come handy should a user want
to use clang as C pre-processor
parent 04cf1ba0
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,27 @@
#define __POP_FC_STDLIB
#endif
#ifdef __clang__
# define __CLANG_IGNORE_ATTRS_PUSH__ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunknown-attributes\"")
# define __CLANG_IGNORE_ATTRS_POP__ \
_Pragma("clang diagnostic pop")
#else
# define __CLANG_IGNORE_ATTRS_PUSH__
# define __CLANG_IGNORE_ATTRS_POP__
#endif
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# define __BEGIN_DECLS \
extern "C" { \
__CLANG_IGNORE_ATTRS_PUSH__
# define __END_DECLS \
__CLANG_IGNORE_ATTRS_POP__ \
}
#else
# define __BEGIN_DECLS
# define __END_DECLS
# define __BEGIN_DECLS __CLANG_IGNORE_ATTRS_PUSH__
# define __END_DECLS __CLANG_IGNORE_ATTRS_POP__
#endif
#undef __LEAF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment