diff --git a/ChangeLog b/ChangeLog index 713b954a..6b94b5c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2019-06-20 Jay Berkenbilt + * Enable compilation with additional warnings for integer + conversion and sign (-Wsign-conversion, -Wconversion for gcc and + similar; -W3 for msvc) if supported. These warnings are on by + default can be turned off by passing --disable-int-warnings + * Fix all integer sign and conversion warnings. This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. diff --git a/autofiles.sums b/autofiles.sums index e1784120..3c5831e4 100644 --- a/autofiles.sums +++ b/autofiles.sums @@ -1,4 +1,4 @@ -585322e3ca6c33acd1d8e3eb3da767c964e93f6fbeb0cf0d2c0cd11bb0b0a445 configure.ac +1135dabc4af0e846647cd99776813a284a740063e3eb77bcfc327b1cc851b8c0 configure.ac 35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4 37f8897d5f68d7d484e5457832a8f190ddb7507fa2a467cb7ee2be40a4364643 m4/libtool.m4 e77ebba8361b36f14b4d0927173a034b98c5d05049697a9ded84d85eb99a7990 m4/ltoptions.m4 diff --git a/configure b/configure index 9cb10adc..fa2595a6 100755 --- a/configure +++ b/configure @@ -1440,7 +1440,7 @@ Optional Features: enable linker version script (default is enabled) --enable-werror whether to treat warnings as errors (default is no) --enable-int-warnings whether to turn on integer type warnings (default is - no) + yes) --enable-test-compare-images whether to compare images in test suite; disabled by default, enabling requires ghostscript and tiffcmp @@ -16904,7 +16904,7 @@ if test "${enable_int_warnings+set}" = set; then : qpdf_INT_WARNINGS=0; fi else - qpdf_INT_WARNINGS=0 + qpdf_INT_WARNINGS=1 fi if test "$qpdf_INT_WARNINGS" = "1"; then diff --git a/configure.ac b/configure.ac index 9dba223f..33ec733f 100644 --- a/configure.ac +++ b/configure.ac @@ -396,12 +396,12 @@ fi AC_MSG_CHECKING(for whether to use $try_flags) AC_ARG_ENABLE(int-warnings, AS_HELP_STRING([--enable-int-warnings], - [whether to turn on integer type warnings (default is no)]), + [whether to turn on integer type warnings (default is yes)]), [if test "$enableval" = "yes"; then qpdf_INT_WARNINGS=1; else qpdf_INT_WARNINGS=0; - fi], [qpdf_INT_WARNINGS=0]) + fi], [qpdf_INT_WARNINGS=1]) if test "$qpdf_INT_WARNINGS" = "1"; then AC_MSG_RESULT(yes) WFLAGS="$WFLAGS $try_flags"