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 792715 - [PATCH] Don't declare functions in AC_TRY_COMPILE
[PATCH] Don't declare functions in AC_TRY_COMPILE
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2018-01-20 09:28 UTC by Ting-Wei Lan
Modified: 2018-01-22 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


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

Description Ting-Wei Lan 2018-01-20 09:28:14 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:34:49 UTC
Created attachment 367138 [details] [review]
configure: Don't declare functions in AC_TRY_COMPILE
Comment 2 Claudio Saavedra 2018-01-22 13:31:29 UTC
Looks okay but Ignacio wrote this.
Comment 3 Ignacio Casal Quinteiro (nacho) 2018-01-22 13:43:21 UTC
Fine for me
Comment 4 Claudio Saavedra 2018-01-22 14:14:09 UTC
Review of attachment 367138 [details] [review]:

Please also push to the stable branch.
Comment 5 Ting-Wei Lan 2018-01-22 15:52:12 UTC
Comment on attachment 367138 [details] [review]
configure: Don't declare functions in AC_TRY_COMPILE

Attachment 367138 [details] pushed as d3abf0c - configure: Don't declare functions in AC_TRY_COMPILE
Comment 6 Ting-Wei Lan 2018-01-22 15:54:42 UTC
Attachment 367138 [details] pushed as 87beac1 - configure: Don't declare functions in AC_TRY_COMPILE (gnome-3-26 branch)