mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 19:08:59 +00:00
Use -Wold-style-cast for C++ if supported
Also separate C and C++ warning flags.
This commit is contained in:
parent
a11081085b
commit
7276ab934d
@ -13,12 +13,13 @@ htmldir=@htmldir@
|
|||||||
pdfdir=@pdfdir
|
pdfdir=@pdfdir
|
||||||
CC=@CC@
|
CC=@CC@
|
||||||
WFLAGS=@WFLAGS@
|
WFLAGS=@WFLAGS@
|
||||||
|
CXXWFLAGS=@CXXWFLAGS@
|
||||||
CFLAGS=@CFLAGS@ $(WFLAGS)
|
CFLAGS=@CFLAGS@ $(WFLAGS)
|
||||||
LDFLAGS=@LDFLAGS@
|
LDFLAGS=@LDFLAGS@
|
||||||
LIBS=@LIBS@
|
LIBS=@LIBS@
|
||||||
CPPFLAGS=@CPPFLAGS@
|
CPPFLAGS=@CPPFLAGS@
|
||||||
CXX=@CXX@
|
CXX=@CXX@
|
||||||
CXXFLAGS=@CXXFLAGS@ $(WFLAGS)
|
CXXFLAGS=@CXXFLAGS@ $(CXXWFLAGS) $(WFLAGS)
|
||||||
AR=@AR@
|
AR=@AR@
|
||||||
RANLIB=@RANLIB@
|
RANLIB=@RANLIB@
|
||||||
DLLTOOL=@DLLTOOL@
|
DLLTOOL=@DLLTOOL@
|
||||||
|
17
configure.ac
17
configure.ac
@ -176,6 +176,7 @@ AC_ARG_WITH(buildrules,
|
|||||||
AC_MSG_RESULT($BUILDRULES)
|
AC_MSG_RESULT($BUILDRULES)
|
||||||
|
|
||||||
AC_SUBST(WFLAGS)
|
AC_SUBST(WFLAGS)
|
||||||
|
AC_SUBST(CXXWFLAGS)
|
||||||
qpdf_USE_EXTRA_WARNINGS=0
|
qpdf_USE_EXTRA_WARNINGS=0
|
||||||
if test "$BUILDRULES" = "msvc"; then
|
if test "$BUILDRULES" = "msvc"; then
|
||||||
dnl /w14267 makes warning 4267 a level 1 warning. This warning reports
|
dnl /w14267 makes warning 4267 a level 1 warning. This warning reports
|
||||||
@ -197,6 +198,22 @@ if test "$qpdf_USE_EXTRA_WARNINGS" = "1"; then
|
|||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
if test "$BUILDRULES" != "msvc"; then
|
||||||
|
qpdf_USE_EXTRA_WARNINGS=0
|
||||||
|
try_flags="-Wold-style-cast"
|
||||||
|
AC_MSG_CHECKING(for whether $CXX supports $try_flags)
|
||||||
|
oCXXFLAGS=$CXXFLAGS
|
||||||
|
CXXFLAGS="$CXXFLAGS $try_flags"
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = 1; int b = a; a = b;]])],
|
||||||
|
[qpdf_USE_EXTRA_WARNINGS=1],[qpdf_USE_EXTRA_WARNINGS=0])
|
||||||
|
CXXFLAGS=$oCXXFLAGS
|
||||||
|
if test "$qpdf_USE_EXTRA_WARNINGS" = "1"; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
CXXWFLAGS="$try_flags"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$BUILDRULES" = "msvc"; then
|
if test "$BUILDRULES" = "msvc"; then
|
||||||
try_flags="/WX"
|
try_flags="/WX"
|
||||||
|
@ -73,7 +73,7 @@ endef
|
|||||||
# Usage: $(call libcompile,src,includes)
|
# Usage: $(call libcompile,src,includes)
|
||||||
define c_libcompile
|
define c_libcompile
|
||||||
$(LIBTOOL) --quiet --mode=compile \
|
$(LIBTOOL) --quiet --mode=compile \
|
||||||
$(CC) $(CXXFLAGS) \
|
$(CC) $(CFLAGS) \
|
||||||
$(call libdepflags,$(basename $(call c_src_to_obj,$(1)))) \
|
$(call libdepflags,$(basename $(call c_src_to_obj,$(1)))) \
|
||||||
$(foreach I,$(2),-I$(I)) \
|
$(foreach I,$(2),-I$(I)) \
|
||||||
$(CPPFLAGS) \
|
$(CPPFLAGS) \
|
||||||
|
Loading…
Reference in New Issue
Block a user