GNOME Bugzilla – Bug 792719
[PATCH] Don't declare functions in AC_TRY_COMPILE
Last modified: 2018-01-20 15:51:22 UTC
Please see the patch. Declaring functions in AC_TRY_COMPILE causes the test for -fvisibility=hidden to fail on Clang. AC_TRY_COMPILE puts code to test in the main function, so instead of using 'int main (void) { return 0; }' as test program, we must use 'return 0' without declaring any function. If we declare main function there, it becomes a nested main function inside the global main function. It is supported by GCC, but not by Clang. This causes problems when checking compiler flags: checking for -fvisibility=hidden compiler flag... no
Created attachment 367143 [details] [review] build: Don't declare functions in AC_TRY_COMPILE
Review of attachment 367143 [details] [review]: Already reviewed (and accepted) for GtkSourceView in bug #792718. So looks good.
Attachment 367143 [details] pushed as 916fca8 - build: Don't declare functions in AC_TRY_COMPILE