GNOME Bugzilla – Bug 792720
[PATCH] Don't put includes inside the main function
Last modified: 2018-01-20 12:10:11 UTC
In configure.ac, there is a check for iswalnum: # The following is necessary for Linux libc-5.4.38 AC_MSG_CHECKING(if iswalnum() and friends are properly defined) AC_TRY_LINK([#include <stdlib.h>],[ #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H)) # ifdef HAVE_WCTYPE_H # include <wctype.h> # else # ifdef HAVE_WCHAR_H # include <wchar.h> # endif # endif #else # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c)) #endif iswalnum((wchar_t) 0); ], gdk_working_wctype=yes, gdk_working_wctype=no) The second argument of AC_TRY_LINK is the content of main function. We cannot include any header inside the main function because definitions of inline functions in headers become nested functions, which is not supported by clang.
Created attachment 367144 [details] [review] configure: Move all includes to the first argument of AC_TRY_LINK Putting includes in the second argument of AC_TRY_LINK is not safe. If a header having inline functions is included inside the main function, it becomes a nested function. This is not supported by clang.
Review of attachment 367144 [details] [review]: Okay
Attachment 367144 [details] pushed as c3ededb - configure: Move all includes to the first argument of AC_TRY_LINK