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 792716 - [PATCH] Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE
[PATCH] Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2018-01-20 09:34 UTC by Ting-Wei Lan
Modified: 2018-01-20 12:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure: Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE (1.30 KB, patch)
2018-01-20 09:35 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2018-01-20 09:34:24 UTC
Please see the patch. Declaring functions in AC_TRY_LINK and AC_TRY_COMPILE causes the tests to fail on Clang.

Both AC_TRY_LINK and AC_TRY_COMPILE put 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 -Bsymbolic-functions linker flag... no
checking for -fvisibility=hidden compiler flag... no
Comment 1 Ting-Wei Lan 2018-01-20 09:35:36 UTC
Created attachment 367139 [details] [review]
configure: Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE
Comment 2 Emmanuele Bassi (:ebassi) 2018-01-20 10:57:05 UTC
Review of attachment 367139 [details] [review]:

Thanks!
Comment 3 Ting-Wei Lan 2018-01-20 12:07:52 UTC
Attachment 367139 [details] pushed as 7a46910 - configure: Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE