After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792719 - [PATCH] Don't declare functions in AC_TRY_COMPILE
[PATCH] Don't declare functions in AC_TRY_COMPILE
Status: RESOLVED FIXED
Product: gspell
Classification: Other
Component: general
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: gspell maintainers
gspell maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-20 09:45 UTC by Ting-Wei Lan
Modified: 2018-01-20 15:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Don't declare functions in AC_TRY_COMPILE (874 bytes, patch)
2018-01-20 09:46 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2018-01-20 09:45:39 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
Comment 1 Ting-Wei Lan 2018-01-20 09:46:35 UTC
Created attachment 367143 [details] [review]
build: Don't declare functions in AC_TRY_COMPILE
Comment 2 Sébastien Wilmet 2018-01-20 15:24:21 UTC
Review of attachment 367143 [details] [review]:

Already reviewed (and accepted) for GtkSourceView in bug #792718. So looks good.
Comment 3 Ting-Wei Lan 2018-01-20 15:51:19 UTC
Attachment 367143 [details] pushed as 916fca8 - build: Don't declare functions in AC_TRY_COMPILE