[Libreoffice-commits] .: 4 commits - configure.in connectivity/source cppuhelper/inc

Tor Lillqvist tml at kemper.freedesktop.org
Tue Apr 24 14:02:39 PDT 2012


 configure.in                                                 |  114 +++++++----
 connectivity/source/drivers/macab/MacabPreparedStatement.hxx |    4 
 cppuhelper/inc/cppuhelper/interfacecontainer.h               |    2 
 3 files changed, 86 insertions(+), 34 deletions(-)

New commits:
commit e5143062887093037cab8f936288af8408576ea8
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Apr 24 22:30:03 2012 +0300

    Visibility doesn't seem to work as we want in Apple's Clang
    
    Or maybe it's the Mach-O object file format that lacks the
    functionality? Anyway, let's try to manage without visibility then.

diff --git a/configure.in b/configure.in
index 5618f1e..9fcc1f8 100644
--- a/configure.in
+++ b/configure.in
@@ -4540,6 +4540,15 @@ if test "$GCC" = "yes"; then
     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
     CFLAGS=$save_CFLAGS
+
+    if test "$COM_GCC_IS_CLANG" = TRUE -a $_os = Darwin; then
+        # It seems that with Apple's Clang, visibility doesn't work as
+        # we would want at least in the connectivity and dbaccess
+        # modules. This might be because of something peculiar in
+        # those modules? Whatever.
+        HAVE_GCC_VISIBILITY_FEATURE=
+    fi
+
     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
         AC_MSG_RESULT([yes])
     else
commit f024b6804d216c4eee2ebd09074eff2ca1984997
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Apr 24 22:25:20 2012 +0300

    Work around Clang 3.1's "argument unused during compilation" non-warning
    
    For unrecognized options, Clang 3.1 (and ealier?) prints out a
    warning, but it isn't a real warning as it doesn't cause a compilation
    error with -Werror, so it is impossible to find out reliably if an
    option is supported or not. So hardcode the information we know.

diff --git a/configure.in b/configure.in
index de31aec..5618f1e 100644
--- a/configure.in
+++ b/configure.in
@@ -2512,7 +2512,7 @@ dnl ===================================================================
 dnl  Test the gcc version
 dnl ===================================================================
 if test "$GCC" = "yes"; then
-    AC_MSG_CHECKING([the GNU C compiler version])
+    AC_MSG_CHECKING([the GCC version])
     _gcc_version=`$CC -dumpversion`
     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
@@ -2537,13 +2537,10 @@ if test "$GCC" = "yes"; then
 fi
 
 dnl ===================================================================
-dnl  Is it actually Clang?
+dnl  Is GCC actually Clang?
 dnl ===================================================================
 
 COM_GCC_IS_CLANG=
-HAVE_GCC_GGDB2=
-HAVE_GCC_FINLINE_LIMIT=
-HAVE_GCC_FNO_INLINE=
 if test "$GCC" = "yes"; then
     AC_MSG_CHECKING([whether GCC is actually Clang])
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
@@ -2556,15 +2553,37 @@ if test "$GCC" = "yes"; then
          COM_GCC_IS_CLANG=TRUE],
         [AC_MSG_RESULT([no])])
 
-    # check various GCC options that Clang does not support now but maybe
-    # will somewhen in the future, check them even for GCC, so that the flags
-    # are set
+    if test "$COM_GCC_IS_CLANG" = TRUE; then
+        AC_MSG_CHECKING([the Clang version])
+        clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
+        CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
+        CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
+        AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
+    fi
+fi
+AC_SUBST(COM_GCC_IS_CLANG)
+
+# ===================================================================
+# check various GCC options that Clang does not support now but maybe
+# will somewhen in the future, check them even for GCC, so that the
+# flags are set
+# ===================================================================
 
+HAVE_GCC_GGDB2=
+HAVE_GCC_FINLINE_LIMIT=
+HAVE_GCC_FNO_INLINE=
+if test "$GCC" = "yes"; then
     AC_MSG_CHECKING([whether $CC supports -ggdb2])
-    save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -ggdb2"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
-    CFLAGS=$save_CFLAGS
+    if test -n "$CLANGVER" -a "$CLANGVER" -le 30100; then
+        # Option just ignored and silly warning that isn't a real
+        # warning printed
+        :
+    else
+        save_CFLAGS=$CFLAGS
+        CFLAGS="$CFLAGS -Werror -ggdb2"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
+        CFLAGS=$save_CFLAGS
+    fi
     if test "$HAVE_GCC_GGDB2" = "TRUE"; then
         AC_MSG_RESULT([yes])
     else
@@ -2572,10 +2591,15 @@ if test "$GCC" = "yes"; then
     fi
 
     AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
-    save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -finline-limit=0"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
-    CFLAGS=$save_CFLAGS
+    if test -n "$CLANGVER" -a "$CLANGVER" -le 30100; then
+        # As above
+        :
+    else
+        save_CFLAGS=$CFLAGS
+        CFLAGS="$CFLAGS -Werror -finline-limit=0"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
+        CFLAGS=$save_CFLAGS
+    fi
     if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
         AC_MSG_RESULT([yes])
     else
@@ -2583,17 +2607,21 @@ if test "$GCC" = "yes"; then
     fi
 
     AC_MSG_CHECKING([whether $CC supports -fno-inline])
-    save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -fno-inline"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
-    CFLAGS=$save_CFLAGS
+    if test -n "$CLANGVER" -a "$CLANGVER" -le 30100; then
+        # Ditto
+        :
+    else
+        save_CFLAGS=$CFLAGS
+        CFLAGS="$CFLAGS -Werror -fno-inline"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
+        CFLAGS=$save_CFLAGS
+    fi
     if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
         AC_MSG_RESULT([yes])
     else
         AC_MSG_RESULT([no])
     fi
 fi
-AC_SUBST(COM_GCC_IS_CLANG)
 AC_SUBST(HAVE_GCC_GGDB2)
 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
 AC_SUBST(HAVE_GCC_FNO_INLINE)
@@ -4747,12 +4775,18 @@ HAVE_GCC_FNO_DEFAULT_INLINE=
 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
 if test "$GCC" = "yes"; then
     AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
-    AC_LANG_PUSH([C++])
-    save_CXXFLAGS=$CXXFLAGS
-    CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
-    CXXFLAGS=$save_CXXFLAGS
-    AC_LANG_POP([C++])
+    if test -n "$CLANGVER" -a "$CLANGVER" -le 30100; then
+        # Option just ignored and silly warning that isn't a real
+        # warning printed
+        :
+    else
+        AC_LANG_PUSH([C++])
+        save_CXXFLAGS=$CXXFLAGS
+        CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
+        CXXFLAGS=$save_CXXFLAGS
+        AC_LANG_POP([C++])
+    fi
     if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
         AC_MSG_RESULT([yes])
     else
@@ -4760,12 +4794,17 @@ if test "$GCC" = "yes"; then
     fi
 
     AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
-    AC_LANG_PUSH([C++])
-    save_CXXFLAGS=$CXXFLAGS
-    CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
-    CXXFLAGS=$save_CXXFLAGS
-    AC_LANG_POP([C++])
+    if test -n "$CLANGVER" -a "$CLANGVER" -le 30100; then
+        # As above
+        :
+    else
+        AC_LANG_PUSH([C++])
+        save_CXXFLAGS=$CXXFLAGS
+        CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
+        CXXFLAGS=$save_CXXFLAGS
+        AC_LANG_POP([C++])
+    fi
     if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
         AC_MSG_RESULT([yes])
     else
commit 98e12520b104ff3b7d2d35a4ba9bd96ee7fa4e72
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Apr 24 22:24:24 2012 +0300

    WaE: make the overloaded-virtual mess here just a warning even with -Werror

diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.hxx b/connectivity/source/drivers/macab/MacabPreparedStatement.hxx
index 15443ef..c387587 100644
--- a/connectivity/source/drivers/macab/MacabPreparedStatement.hxx
+++ b/connectivity/source/drivers/macab/MacabPreparedStatement.hxx
@@ -36,6 +36,10 @@
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
 #include <cppuhelper/implbase4.hxx>
 
+#ifdef __clang__
+#pragma clang diagnostic warning "-Woverloaded-virtual"
+#endif
+
 namespace connectivity
 {
     namespace macab
commit ac1a6df9c8d73583cf81f24670fcff1991f2e3c4
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Apr 24 21:56:55 2012 +0300

    WaE: implicit conversion changes signedness

diff --git a/cppuhelper/inc/cppuhelper/interfacecontainer.h b/cppuhelper/inc/cppuhelper/interfacecontainer.h
index 77c39f6..251297d 100644
--- a/cppuhelper/inc/cppuhelper/interfacecontainer.h
+++ b/cppuhelper/inc/cppuhelper/interfacecontainer.h
@@ -509,7 +509,7 @@ struct OBroadcastHelperVar
 struct hashType_Impl
 {
     size_t operator()(const ::com::sun::star::uno::Type & s) const SAL_THROW(())
-        { return s.getTypeName().hashCode(); }
+    { return (size_t) s.getTypeName().hashCode(); }
 };
 
 


More information about the Libreoffice-commits mailing list