bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_C_INLINE with -Werror llvm 3.4


From: Kurt Schwehr
Subject: AC_C_INLINE with -Werror llvm 3.4
Date: Sun, 8 Jun 2014 09:25:15 -0700

I'm trying to clean hdf5 1.9.182 a bit and I'm using -Werror as my first
pass tool.  Just cleaning the messages that come up.  However, passing
-Werror as CPPFLAGS causes configure to die on a number of places.  Here is
a first one with a proposed fix.  The AC_C_INLINE macro tries to compile an
inline function, but doesn't use it.  Why not just make the return 0 be
returning the zero from the static_foo inline function to insure that it's
used?

git diff
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index b58e42d..6779407 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1742,7 +1742,7 @@ for ac_kw in inline __inline__ __inline; do
 [#ifndef __cplusplus
 typedef int foo_t;
 static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
+$ac_kw foo_t foo () {return static_foo; }
 #endif
 ])],
                    [ac_cv_c_inline=$ac_kw])


Found via:

ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots/v19/hdf5-1.9.182.tar.bz2

tar xf hdf5-1.9.182.tar.bz2
mkdir build && cd build
CPPFLAGS="-Werror -Wall -Wextra" ../hdf5-1.9.182/configure --enable-shared
--enable-cxx --with-zlib=/usr --without-mpe --with-szlib=/sw
--without-pthread --disable-parallel --enable-build-all
--enable-maintainer-mode --enable-codestack --enable-debug=all
--disable-silent-rules

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by HDF5 configure 1.9.182, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ../hdf5-1.9.182/configure --enable-shared --enable-cxx --with-zlib=/usr
--without-mpe --with-szlib=/sw --without-pthread --disable-parallel
--enable-build-all --enable-maintainer-mode --enable-codestack
--enable-debug=all --disable-silent-rules


configure:27495: clang -c          -Werror=unused-variable -Wall -Wextra
-I/sw/include conftest.c >&5
configure:27495: $? = 0
configure:27502: result: yes
configure:27510: checking for inline
configure:27526: clang -c          -Werror=unused-variable -Wall -Wextra
-I/sw/include conftest.c >&5
conftest.c:132:21: warning: unused function 'static_foo' [-Wunused-function]
static inline foo_t static_foo () {return 0; }
                    ^
1 warning generated.
configure:27526: $? = 0
configure:27534: result: inline


configure.ac has:

## ----------------------------------------------------------------------
## Check compiler characteristics
##
AC_C_CONST
AC_C_INLINE


clang --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix

xcodebuild -version
Xcode 5.1.1
Build version 5B1008

uname -a
Darwin schwehr-macbookpro 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17
23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64


reply via email to

[Prev in Thread] Current Thread [Next in Thread]