configure.ac (cxx_compat_warn): Set if -Wc++-compat is supported.

* configure.ac (cxx_compat_warn): Set if -Wc++-compat is supported.
        * Makefile.in (CXX_COMPAT_WARN): Define.
        * configure: Regenerate.

cp/
        * Make-lang.in (cp-warn): Include CXX_COMPAT_WARN.
        * repo.c (extract_string, afgets): Use cast when converting from
        void *.

From-SVN: r110380
This commit is contained in:
Gabriel Dos Reis 2006-01-29 19:51:40 +00:00
parent 2a1d634643
commit 373477bba3
7 changed files with 316 additions and 132 deletions

View File

@ -1,3 +1,9 @@
2006-01-29 Gabriel Dos Reis <gdr@integgrable-solutions.net>
* configure.ac (cxx_compat_warn): Set if -Wc++-compat is supported.
* Makefile.in (CXX_COMPAT_WARN): Define.
* configure: Regenerate.
2006-01-29 Dorit Nuzman <dorit@il.ibm.com> 2006-01-29 Dorit Nuzman <dorit@il.ibm.com>
PR tree-opt/25911 PR tree-opt/25911

View File

@ -173,12 +173,14 @@ coverageexts = .{gcda,gcno}
# with other compilers. This is partially controlled by configure in # with other compilers. This is partially controlled by configure in
# stage1, as not all versions of gcc understand -Wno-long-long or # stage1, as not all versions of gcc understand -Wno-long-long or
# -Wno-variadic-macros. # -Wno-variadic-macros.
# CXX_COMPAT_WARN are C++ source compatibility warnings.
LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
STRICT_WARN = @strict1_warn@ STRICT_WARN = @strict1_warn@
WERROR_FLAGS = @WERROR@ WERROR_FLAGS = @WERROR@
STRICT2_WARN = -pedantic -Wno-long-long -Wno-variadic-macros \ STRICT2_WARN = -pedantic -Wno-long-long -Wno-variadic-macros \
-Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute \ -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute \
$(WERROR_FLAGS) $(WERROR_FLAGS)
CXX_COMPAT_WARN = @cxx_compat_warn@
# This is set by --enable-checking. The idea is to catch forgotten # This is set by --enable-checking. The idea is to catch forgotten
# "extern" tags in header files. # "extern" tags in header files.

411
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -385,6 +385,23 @@ fi
AC_SUBST(strict1_warn) AC_SUBST(strict1_warn)
# Get C++ compatibility warning flag, if supported.
AC_CACHE_CHECK(
[whether ${CC} accepts -Wc++-compat],
[ac_cv_prog_cc_w_cxx_compat],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wc++-compat"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_cxx_compat=yes],
[ac_cv_prog_cc_w_cxx_compat=no])
CFLAGS="$save_CFLAGS"
])
if test x${ac_cv_prog_cc_w_cxx_compat} = xyes; then
cxx_compat_warn="-Wc++-compat"
fi
AC_SUBST(cxx_compat_warn)
# If the native compiler is GCC, we can enable warnings even in stage1. # If the native compiler is GCC, we can enable warnings even in stage1.
# That's useful for people building cross-compilers, or just running a # That's useful for people building cross-compilers, or just running a
# quick `make'. # quick `make'.

View File

@ -1,3 +1,9 @@
2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
* Make-lang.in (cp-warn): Include CXX_COMPAT_WARN.
* repo.c (extract_string, afgets): Use cast when converting from
void *.
2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net> 2006-01-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
* call.c (alloc_conversion): Use cast when converting from void *. * call.c (alloc_conversion): Use cast when converting from void *.

View File

@ -89,7 +89,7 @@ CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS) CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS)
# Use strict warnings for this front end. # Use strict warnings for this front end.
cp-warn = $(STRICT_WARN) cp-warn = $(STRICT_WARN) $(CXX_COMPAT_WARN)
cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \

View File

@ -85,7 +85,7 @@ extract_string (char **pp)
obstack_1grow (&temporary_obstack, '\0'); obstack_1grow (&temporary_obstack, '\0');
*pp = p; *pp = p;
return obstack_finish (&temporary_obstack); return (char *) obstack_finish (&temporary_obstack);
} }
static const char * static const char *
@ -148,7 +148,7 @@ afgets (FILE *stream)
if (obstack_object_size (&temporary_obstack) == 0) if (obstack_object_size (&temporary_obstack) == 0)
return NULL; return NULL;
obstack_1grow (&temporary_obstack, '\0'); obstack_1grow (&temporary_obstack, '\0');
return obstack_finish (&temporary_obstack); return (char *) obstack_finish (&temporary_obstack);
} }
void void