summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-08 03:20:30 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-08 03:20:30 +0000
commit643df0593c630691fa6877cddeefdd4c3023d444 (patch)
tree1eb48ad31d05a9ce117bedc17115de96dffa2f0b /libcpp
parent54f3f029d816c6d1626310649adfda740e203f7b (diff)
parentd5d8f1ccc6d3972dc5cfc0949e85e0b1c9e24ee0 (diff)
downloadgcc-transactional-memory.tar.gz
* Merge from mainline rev 181122.transactional-memory
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/transactional-memory@181148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog17
-rw-r--r--libcpp/Makefile.in4
-rwxr-xr-xlibcpp/configure44
-rw-r--r--libcpp/configure.ac6
-rw-r--r--libcpp/internal.h12
5 files changed, 74 insertions, 9 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 64ed4683669..8f7d494fc91 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,20 @@
+2011-11-03 Michael Matz <matz@suse.de>
+
+ PR bootstrap/50857
+ * configure.ac: Check for -fno-exceptions -fno-rtti.
+ * configure: Regenerate.
+ * Makefile.in (NOEXCEPTION_FLAGS): New flag.
+ (ALL_CXXFLAGS): Use it.
+
+2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
+
+2011-11-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/50810
+ * configure.ac: Add -Wno-narrowing to warning options.
+
2011-10-31 Jason Merrill <jason@redhat.com>
PR libstdc++/1773
diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
index 33c44b542df..d6df46d62c9 100644
--- a/libcpp/Makefile.in
+++ b/libcpp/Makefile.in
@@ -56,6 +56,7 @@ XGETTEXT = @XGETTEXT@
CCDEPMODE = @CCDEPMODE@
CXXDEPMODE = @CXXDEPMODE@
DEPDIR = @DEPDIR@
+NOEXCEPTION_FLAGS = @noexception_flags@
datarootdir = @datarootdir@
datadir = @datadir@
@@ -72,7 +73,8 @@ INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
-I$(srcdir)/include
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
-ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(INCLUDES) $(CPPFLAGS)
+ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
+ $(CPPFLAGS)
# The name of the compiler to use.
ENABLE_BUILD_WITH_CXX = @ENABLE_BUILD_WITH_CXX@
diff --git a/libcpp/configure b/libcpp/configure
index c400d23a93d..803daae2b2e 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -616,6 +616,7 @@ CCDEPMODE
DEPDIR
am__leading_dot
WERROR
+noexception_flags
WARN_PEDANTIC
c_warn
warn
@@ -4687,7 +4688,7 @@ test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader"
warn=
save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wwrite-strings \
+for option in -W -Wall -Wno-narrowing -Wwrite-strings \
-Wmissing-format-attribute; do
as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
@@ -4802,6 +4803,47 @@ fi
fi
+# Disable exceptions and RTTI if building with g++
+noexception_flags=
+save_CFLAGS="$CFLAGS"
+for option in -fno-exceptions -fno-rtti; do
+ as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
+$as_echo_n "checking whether $CC supports $option... " >&6; }
+if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ CFLAGS="$option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_acx_Woption=yes"
+else
+ eval "$as_acx_Woption=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+eval ac_res=\$$as_acx_Woption
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
+ noexception_flags="$noexception_flags${noexception_flags:+ }$option"
+fi
+ done
+CFLAGS="$save_CFLAGS"
+
+
# Only enable with --enable-werror-always until existing warnings are
# corrected.
WERROR=
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index e1d88511c78..83d5bb6e827 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -33,12 +33,16 @@ AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
-ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings \
+ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
-Wmissing-format-attribute], [warn])
ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
-Wold-style-definition -Wc++-compat], [c_warn])
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
+# Disable exceptions and RTTI if building with g++
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
+
# Only enable with --enable-werror-always until existing warnings are
# corrected.
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
diff --git a/libcpp/internal.h b/libcpp/internal.h
index e60330df490..b3dc2df10bf 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -739,8 +739,8 @@ static inline int ustrcmp (const unsigned char *, const unsigned char *);
static inline int ustrncmp (const unsigned char *, const unsigned char *,
size_t);
static inline size_t ustrlen (const unsigned char *);
-static inline unsigned char *uxstrdup (const unsigned char *);
-static inline unsigned char *ustrchr (const unsigned char *, int);
+static inline const unsigned char *uxstrdup (const unsigned char *);
+static inline const unsigned char *ustrchr (const unsigned char *, int);
static inline int ufputs (const unsigned char *, FILE *);
/* Use a const char for the second parameter since it is usually a literal. */
@@ -770,16 +770,16 @@ ustrlen (const unsigned char *s1)
return strlen ((const char *)s1);
}
-static inline unsigned char *
+static inline const unsigned char *
uxstrdup (const unsigned char *s1)
{
- return (unsigned char *) xstrdup ((const char *)s1);
+ return (const unsigned char *) xstrdup ((const char *)s1);
}
-static inline unsigned char *
+static inline const unsigned char *
ustrchr (const unsigned char *s1, int c)
{
- return (unsigned char *) strchr ((const char *)s1, c);
+ return (const unsigned char *) strchr ((const char *)s1, c);
}
static inline int