How do I use -fexceptions?
Steven T. Hatton
hattons at globalsymmetry.com
Fri May 21 08:26:51 BST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 21 May 2004 02:42 am, Ainsley Pereira wrote:
> You have both -fexceptions and -fno-exceptions in there.
Yes, but _I_ didn't put the latter there.
> I think you
> just need to take -fno-exceptions out. (In fact, I think you could
> probably take both out, exceptions should be on by default.)
I agree.
I believe there is something wrong with KDevelop's setup. I should have
stated that I'm using the latest CVS. I figured I'd ask on the user list
before I filed a bug report.
Looking through the acinclude.m4 and aclocal.m4 in the project I see the
following:
aclocal.m4: L2965
if test "$GXX" = "yes"; then
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS
- -fno-exceptions"])
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS
- -fno-check-new"])
KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"],
USE_EXCEPTIONS= )
fi
aclocal.m4:L4169
AC_DEFUN([KDE_CHECK_STL],
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
AC_MSG_CHECKING([if C++ programs can be compiled])
AC_CACHE_VAL(kde_cv_stl_works,
[
AC_TRY_COMPILE([
#include <string>
using namespace std;
],[
string astring="Hallo Welt.";
astring.erase(0, 6); // now astring is "Welt"
return 0;
], kde_cv_stl_works=yes,
kde_cv_stl_works=no)
])
AC_MSG_RESULT($kde_cv_stl_works)
if test "$kde_cv_stl_works" = "yes"; then
# back compatible
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation
by SGI])
else
AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
Check config.log for details - if you're using a Linux distribution you might
miss
a package named similiar to libstd++-dev.])
fi
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
aclocal.m4:L8010
# We don't want -fno-exception wen compiling C++ code, so set the
# no_builtin_flag separately
if test "$GXX" = yes; then
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
else
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
aclocal:L9612
if test "$GCC" = yes; then
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti
- -fno-exceptions],
lt_cv_prog_compiler_rtti_exceptions,
[-fno-rtti -fno-exceptions], [],
[_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag,
$1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti
- -fno-exceptions"])
fi
acinclude.m4:L2953
if test "$GXX" = "yes"; then
KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS
- -fno-exceptions"])
KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS
- -fno-check-new"])
KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"],
USE_EXCEPTIONS= )
fi
if test "$CXX" = "KCC"; then
dnl unfortunately we currently cannot disable exception support in KCC
dnl because doing so is binary incompatible and Qt by default links with
exceptions :-(
dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS
- --no_exceptions"])
dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"],
USE_EXCEPTIONS= )
AC_ARG_ENABLE(pch,
AC_HELP_STRING([--enable-pch],
[enables precompiled header support (currently only KCC)
[default=no]]),
[
kde_use_pch=$enableval
],[kde_use_pch=no])
if test "$kde_use_pch" = "yes"; then
dnl TODO: support --pch-dir!
KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
dnl the below works (but the dir must exist), but it's
dnl useless for a whole package.
dnl The are precompiled headers for each source file, so when compiling
dnl from scratch, it doesn't make a difference, and they take up
dnl around ~5Mb _per_ sourcefile.
dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
fi
acinclude.m4:L4157
AC_DEFUN([KDE_CHECK_STL],
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
AC_MSG_CHECKING([if C++ programs can be compiled])
AC_CACHE_VAL(kde_cv_stl_works,
[
AC_TRY_COMPILE([
#include <string>
using namespace std;
],[
string astring="Hallo Welt.";
astring.erase(0, 6); // now astring is "Welt"
return 0;
], kde_cv_stl_works=yes,
kde_cv_stl_works=no)
])
AC_MSG_RESULT($kde_cv_stl_works)
if test "$kde_cv_stl_works" = "yes"; then
# back compatible
AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation
by SGI])
else
AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
Check config.log for details - if you're using a Linux distribution you might
miss
a package named similiar to libstd++-dev.])
fi
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
acinclude.m4:L8024
# We don't want -fno-exception wen compiling C++ code, so set the
# no_builtin_flag separately
if test "$GXX" = yes; then
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
else
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
acinclude.m4:L9644
if test "$GCC" = yes; then
_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti
- -fno-exceptions],
lt_cv_prog_compiler_rtti_exceptions,
[-fno-rtti -fno-exceptions], [],
[_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag,
$1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti
- -fno-exceptions"])
fi
])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAra9OwX61+IL0QsMRAqNhAKD0zRLqnAtPfnY/YJLDr7nv+7ALCACgxX77
ldO1JItsSgEARYKjqXz55No=
=OIpW
-----END PGP SIGNATURE-----
-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«
More information about the KDevelop
mailing list