From: Peter Griess Date: Tue, 10 Sep 2013 20:33:09 +0000 (-0500) Subject: Fix ifunc test in configure.ac to make unknown attribute warnings fatal. X-Git-Tag: v0.22.0~849 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c6e51ca2fdc103df2fbc630e2c994df776066807;p=folly.git Fix ifunc test in configure.ac to make unknown attribute warnings fatal. Summary: - By default, GCC only warns on unknown attributes. As a result our FOLLY_HAVE_IFUNC test doesn't actually catch instances where we don't support this. Test Plan: - fbconfig -r folly && fbmake runtests - ./configure && make check on Ubuntu/FC/Mac Reviewed By: oyamauchi@fb.com FB internal diff: D998506 --- diff --git a/folly/configure.ac b/folly/configure.ac index cd0489af..664c83d5 100644 --- a/folly/configure.ac +++ b/folly/configure.ac @@ -58,8 +58,11 @@ AC_CHECK_TYPE([__int128], [AC_DEFINE([HAVE_INT128_T], [0], [Define if __int128 does not exist])]) AC_CHECK_TYPES([ptrdiff_t]) AC_COMPILE_IFELSE( - [AC_LANG_SOURCE[extern "C" void (*test_ifunc(void))() { return 0; } - void func() __attribute__((ifunc("test_ifunc")));]], + [AC_LANG_SOURCE[ + #pragma GCC diagnostic error "-Wattributes" + extern "C" void (*test_ifunc(void))() { return 0; } + void func() __attribute__((ifunc("test_ifunc")));] + ], [AC_DEFINE([HAVE_IFUNC], [1], [Define to 1 if the compiler supports ifunc])], [AC_DEFINE([HAVE_IFUNC], [0], [Define to 0 if the compiler doesn't support ifunc])] )