Kaydet (Commit) d7b46ef1 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove obsolete GCC version checks

...after <https://gerrit.libreoffice.org/63951> "Bump (Linux) GCC baseline to
7.0.0".  (In some cases, those checks now need to check for __clang__, which was
implicitly covered in the past by Clang consistently reporting to be
GCC 4.2.1.)

Change-Id: I860fef8c4ca41c22a7541f0fb2d34b37d1d69bed
Reviewed-on: https://gerrit.libreoffice.org/63952
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 65b9c623
...@@ -6258,13 +6258,13 @@ elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then ...@@ -6258,13 +6258,13 @@ elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
#if defined SYSTEM_LIBCMIS #if defined SYSTEM_LIBCMIS
// See ucb/source/ucp/cmis/auth_provider.hxx: // See ucb/source/ucp/cmis/auth_provider.hxx:
#if __GNUC__ >= 7 #if !defined __clang__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif #endif
#include <libcmis/libcmis.hxx> #include <libcmis/libcmis.hxx>
#if __GNUC__ >= 7 #if !defined __clang__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
#endif #endif
......
...@@ -444,7 +444,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 parameterIndex, co ...@@ -444,7 +444,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 parameterIndex, co
break; break;
} }
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
[[fallthrough]]; [[fallthrough]];
#else #else
BOOST_FALLTHROUGH; BOOST_FALLTHROUGH;
......
...@@ -444,7 +444,7 @@ void Test::testBigStruct() { ...@@ -444,7 +444,7 @@ void Test::testBigStruct() {
CPPUNIT_ASSERT_EQUAL(static_cast< sal_Int32 >(0), guard.p->m23.getLength()); CPPUNIT_ASSERT_EQUAL(static_cast< sal_Int32 >(0), guard.p->m23.getLength());
//This is a very platform specific test. //This is a very platform specific test.
#if defined __GNUC__ && __GNUC__ >= 3 // see CPPU_GCC3_ALIGN #if defined __GNUC__ // see CPPU_GCC3_ALIGN
#if defined(LINUX) && (defined (X86_64) || defined(X86) || defined(PPC)) #if defined(LINUX) && (defined (X86_64) || defined(X86) || defined(PPC))
CPPUNIT_ASSERT_EQUAL( CPPUNIT_ASSERT_EQUAL(
#if defined X86_64 || defined PPC #if defined X86_64 || defined PPC
......
...@@ -33,22 +33,6 @@ $(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\ ...@@ -33,22 +33,6 @@ $(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
)) ))
endif endif
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58864
# can't easily check for 4.8.2 exactly so just apply to GCC 4.8.x
ifeq ($(COM),GCC)
ifeq ($(COM_IS_CLANG),)
ifeq ($(CPUNAME),INTEL)
ifeq ($(shell expr '$(GCC_VERSION)' '<' 409),1)
ifeq ($(shell expr '$(GCC_VERSION)' '>=' 408),1)
$(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
-march=i586 \
))
endif
endif
endif
endif
endif
$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,poppler,cc)) $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,poppler,cc))
$(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
......
...@@ -112,7 +112,7 @@ template<typename T> inline bool checked_sub(T a, T b, T& result) ...@@ -112,7 +112,7 @@ template<typename T> inline bool checked_sub(T a, T b, T& result)
return !msl::utilities::SafeSubtract(a, b, result); return !msl::utilities::SafeSubtract(a, b, result);
} }
#elif (defined __GNUC__ && __GNUC__ >= 5) || (__has_builtin(__builtin_mul_overflow) && !(defined ANDROID && defined __clang__) && !(defined(__clang__) && defined(__i386__))) #elif (defined __GNUC__ && !defined __clang__) || (__has_builtin(__builtin_mul_overflow) && !(defined ANDROID && defined __clang__) && !(defined(__clang__) && defined(__i386__)))
// 32-bit clang fails with undefined reference to `__mulodi4' // 32-bit clang fails with undefined reference to `__mulodi4'
template<typename T> inline bool checked_multiply(T a, T b, T& result) template<typename T> inline bool checked_multiply(T a, T b, T& result)
......
...@@ -229,12 +229,7 @@ struct ConstCharArrayDetector<sal_Unicode const [N], T> { ...@@ -229,12 +229,7 @@ struct ConstCharArrayDetector<sal_Unicode const [N], T> {
{ return literal; } { return literal; }
}; };
template<typename T> struct ConstCharArrayDetector< template<typename T> struct ConstCharArrayDetector<
#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 8 \
&& !defined __clang__
OUStringLiteral1_ const,
#else
OUStringLiteral1, OUStringLiteral1,
#endif
T> T>
{ {
using TypeUtf16 = T; using TypeUtf16 = T;
...@@ -260,12 +255,7 @@ struct ExceptConstCharArrayDetector< const char[ N ] > ...@@ -260,12 +255,7 @@ struct ExceptConstCharArrayDetector< const char[ N ] >
template<std::size_t N> template<std::size_t N>
struct ExceptConstCharArrayDetector<sal_Unicode const[N]> {}; struct ExceptConstCharArrayDetector<sal_Unicode const[N]> {};
template<> struct ExceptConstCharArrayDetector< template<> struct ExceptConstCharArrayDetector<
#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 8 \
&& !defined __clang__
OUStringLiteral1_ const
#else
OUStringLiteral1 OUStringLiteral1
#endif
> >
{}; {};
#endif #endif
......
...@@ -678,7 +678,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) { ...@@ -678,7 +678,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
#define __has_attribute(x) 0 #define __has_attribute(x) 0
#endif #endif
#if defined LIBO_INTERNAL_ONLY && ((defined __GNUC__ && __GNUC__ > 4) || (defined __clang__ && __has_attribute(returns_nonnull))) #if defined LIBO_INTERNAL_ONLY && ((defined __GNUC__ && !defined __clang__) || (defined __clang__ && __has_attribute(returns_nonnull)))
#define SAL_RETURNS_NONNULL __attribute__((returns_nonnull)) #define SAL_RETURNS_NONNULL __attribute__((returns_nonnull))
#else #else
#define SAL_RETURNS_NONNULL #define SAL_RETURNS_NONNULL
......
...@@ -100,7 +100,9 @@ gb_CXXFLAGS_COMMON += -ffunction-sections -fdata-sections ...@@ -100,7 +100,9 @@ gb_CXXFLAGS_COMMON += -ffunction-sections -fdata-sections
gb_LinkTarget_LDFLAGS += -Wl,--gc-sections gb_LinkTarget_LDFLAGS += -Wl,--gc-sections
endif endif
ifeq ($(shell expr '$(GCC_VERSION)' '>=' 600),1) ifeq ($(COM_IS_CLANG),TRUE)
gb_CXXFLAGS_COMMON += -Wimplicit-fallthrough
else
gb_CFLAGS_COMMON += \ gb_CFLAGS_COMMON += \
-Wduplicated-cond \ -Wduplicated-cond \
-Wlogical-op \ -Wlogical-op \
...@@ -119,16 +121,6 @@ gb_CXXFLAGS_COMMON += \ ...@@ -119,16 +121,6 @@ gb_CXXFLAGS_COMMON += \
-Wno-cast-function-type -Wno-cast-function-type
endif endif
ifeq ($(COM_IS_CLANG),TRUE)
gb_CXXFLAGS_COMMON += -Wimplicit-fallthrough
else
# GCC 4.8, at least, is confused by boost 1.66 optional assignments
ifeq ($(shell expr '$(GCC_VERSION)' '<' 409),1)
gb_CXXFLAGS_COMMON += -Wno-maybe-uninitialized
endif
endif
# If CC or CXX already include -fvisibility=hidden, don't duplicate it # If CC or CXX already include -fvisibility=hidden, don't duplicate it
ifeq (,$(filter -fvisibility=hidden,$(CC))) ifeq (,$(filter -fvisibility=hidden,$(CC)))
gb_VISIBILITY_FLAGS := -fvisibility=hidden gb_VISIBILITY_FLAGS := -fvisibility=hidden
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
#ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX
#define INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX #define INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif #endif
#include <libcmis/libcmis.hxx> #include <libcmis/libcmis.hxx>
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
#ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_CERTVALIDATION_HANDLER_HXX #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_CERTVALIDATION_HANDLER_HXX
#define INCLUDED_UCB_SOURCE_UCP_CMIS_CERTVALIDATION_HANDLER_HXX #define INCLUDED_UCB_SOURCE_UCP_CMIS_CERTVALIDATION_HANDLER_HXX
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif #endif
#include <libcmis/libcmis.hxx> #include <libcmis/libcmis.hxx>
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
#include <com/sun/star/document/CmisVersion.hpp> #include <com/sun/star/document/CmisVersion.hpp>
#include <ucbhelper/contenthelper.hxx> #include <ucbhelper/contenthelper.hxx>
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif #endif
#include <libcmis/libcmis.hxx> #include <libcmis/libcmis.hxx>
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif #endif
#include <libcmis/libcmis.hxx> #include <libcmis/libcmis.hxx>
#if defined __GNUC__ && __GNUC__ >= 7 #if defined __GNUC__ && !defined __clang__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment