gmacros: Only set G_ANALYZER_ANALYZING to 1 when clang static analyzer is in use

We set G_ANALYZER_ANALYZING to 1 when clang supporting static analyzing before,
but this will cause compilation error when -Werror=return-type is used and the
static analyzer is not in use because g_error static function only has
__attribute__((analyzer_noreturn)), which is useless for normal compilation.

https://bugzilla.gnome.org/show_bug.cgi?id=741901
This commit is contained in:
Ting-Wei Lan 2015-01-01 13:28:21 +08:00
parent cb86c222cc
commit d7a1d890c1

View File

@ -164,7 +164,7 @@
#endif /* !__GNUC__ */
#endif /* !G_DISABLE_DEPRECATED */
#if __has_feature(attribute_analyzer_noreturn)
#if __has_feature(attribute_analyzer_noreturn) && defined(__clang_analyzer__)
#define G_ANALYZER_ANALYZING 1
#define G_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
#else