[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] using -std=c++0x instead of -std=c++98?
From: |
Vaclav Slavik |
Subject: |
Re: [lmi] using -std=c++0x instead of -std=c++98? |
Date: |
Thu, 18 Mar 2010 09:55:26 +0100 |
On Wed, 2010-03-17 at 19:32 +0000, Greg Chicares wrote:
> It's perfectly okay to require '-std=c++0x' instead of '-std=c++98':
> lmi doesn't need to be backward compatible with old versions of the
> C++ standard in this sense.
Can you please apply this patch, then?
diff --git a/configure.ac b/configure.ac
index 9a63b62..58ac666 100644
--- a/configure.ac
+++ b/configure.ac
@@ -586,7 +586,7 @@ if test "x$GCC" == "xyes"; then
fi
if test "x$GXX" == "xyes"; then
- CXXFLAGS="$CXXFLAGS $CFLAGS_gcc_common -std=c++98 \
+ CXXFLAGS="$CXXFLAGS $CFLAGS_gcc_common \
-Wctor-dtor-privacy \
-Wdeprecated \
-Wnon-template-friend \
@@ -594,6 +594,15 @@ if test "x$GXX" == "xyes"; then
-Wpmf-conversions \
-Wsynth"
+ dnl g++ 4.4 doesn't compile wxWidgets code that relies on use of empty
+ dnl macro arguments, because it's behavior undefined by the standard
+ dnl prior to C++0x or C99; if the compiler is too old to understand
+ dnl -std=c++0x, it's also too old to complain about this and so we can
+ dnl use -std=c++98
+ AX_CXX_CHECK_FLAG([-std=c++0x],[],[],
+ [CXXFLAGS="$CXXFLAGS -std=c++0x"],
+ [CXXFLAGS="$CXXFLAGS -std=c++98"])
+
dnl we need to use this option with g++ 4.3 to prevent its complaints
dnl about "-funit-at-a-time is required for inlining of functions that are
dnl only called once" in debug builds
I didn't do the equivalent for Windows build, because the newest GCC
version supported by it is 4.3 and that one didn't exhibit the problem
yet.
Thanks,
Vaclav