Commit cc2e8853b5a87eefa304c03d2d242a339d942c77

Authored by Jay Berkenbilt
1 parent 63a643a3

Enable int warnings by default

Now that there aren't any more...
ChangeLog
1 2019-06-20 Jay Berkenbilt <ejb@ql.org> 1 2019-06-20 Jay Berkenbilt <ejb@ql.org>
2 2
  3 + * Enable compilation with additional warnings for integer
  4 + conversion and sign (-Wsign-conversion, -Wconversion for gcc and
  5 + similar; -W3 for msvc) if supported. These warnings are on by
  6 + default can be turned off by passing --disable-int-warnings
  7 +
3 * Fix all integer sign and conversion warnings. This makes all 8 * Fix all integer sign and conversion warnings. This makes all
4 integer type conversions that have potential data loss explicit 9 integer type conversions that have potential data loss explicit
5 with calls that do range checks and raise an exception. 10 with calls that do range checks and raise an exception.
autofiles.sums
1 -585322e3ca6c33acd1d8e3eb3da767c964e93f6fbeb0cf0d2c0cd11bb0b0a445 configure.ac 1 +1135dabc4af0e846647cd99776813a284a740063e3eb77bcfc327b1cc851b8c0 configure.ac
2 35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4 2 35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4
3 37f8897d5f68d7d484e5457832a8f190ddb7507fa2a467cb7ee2be40a4364643 m4/libtool.m4 3 37f8897d5f68d7d484e5457832a8f190ddb7507fa2a467cb7ee2be40a4364643 m4/libtool.m4
4 e77ebba8361b36f14b4d0927173a034b98c5d05049697a9ded84d85eb99a7990 m4/ltoptions.m4 4 e77ebba8361b36f14b4d0927173a034b98c5d05049697a9ded84d85eb99a7990 m4/ltoptions.m4
configure
@@ -1440,7 +1440,7 @@ Optional Features: @@ -1440,7 +1440,7 @@ Optional Features:
1440 enable linker version script (default is enabled) 1440 enable linker version script (default is enabled)
1441 --enable-werror whether to treat warnings as errors (default is no) 1441 --enable-werror whether to treat warnings as errors (default is no)
1442 --enable-int-warnings whether to turn on integer type warnings (default is 1442 --enable-int-warnings whether to turn on integer type warnings (default is
1443 - no) 1443 + yes)
1444 --enable-test-compare-images 1444 --enable-test-compare-images
1445 whether to compare images in test suite; disabled by 1445 whether to compare images in test suite; disabled by
1446 default, enabling requires ghostscript and tiffcmp 1446 default, enabling requires ghostscript and tiffcmp
@@ -16904,7 +16904,7 @@ if test &quot;${enable_int_warnings+set}&quot; = set; then : @@ -16904,7 +16904,7 @@ if test &quot;${enable_int_warnings+set}&quot; = set; then :
16904 qpdf_INT_WARNINGS=0; 16904 qpdf_INT_WARNINGS=0;
16905 fi 16905 fi
16906 else 16906 else
16907 - qpdf_INT_WARNINGS=0 16907 + qpdf_INT_WARNINGS=1
16908 fi 16908 fi
16909 16909
16910 if test "$qpdf_INT_WARNINGS" = "1"; then 16910 if test "$qpdf_INT_WARNINGS" = "1"; then
configure.ac
@@ -396,12 +396,12 @@ fi @@ -396,12 +396,12 @@ fi
396 AC_MSG_CHECKING(for whether to use $try_flags) 396 AC_MSG_CHECKING(for whether to use $try_flags)
397 AC_ARG_ENABLE(int-warnings, 397 AC_ARG_ENABLE(int-warnings,
398 AS_HELP_STRING([--enable-int-warnings], 398 AS_HELP_STRING([--enable-int-warnings],
399 - [whether to turn on integer type warnings (default is no)]), 399 + [whether to turn on integer type warnings (default is yes)]),
400 [if test "$enableval" = "yes"; then 400 [if test "$enableval" = "yes"; then
401 qpdf_INT_WARNINGS=1; 401 qpdf_INT_WARNINGS=1;
402 else 402 else
403 qpdf_INT_WARNINGS=0; 403 qpdf_INT_WARNINGS=0;
404 - fi], [qpdf_INT_WARNINGS=0]) 404 + fi], [qpdf_INT_WARNINGS=1])
405 if test "$qpdf_INT_WARNINGS" = "1"; then 405 if test "$qpdf_INT_WARNINGS" = "1"; then
406 AC_MSG_RESULT(yes) 406 AC_MSG_RESULT(yes)
407 WFLAGS="$WFLAGS $try_flags" 407 WFLAGS="$WFLAGS $try_flags"