Commit f562d494b09dd889ac7600cfd22e4d7124e8656c
1 parent
713d9619
configure: add --enable-int-warnings
Showing
3 changed files
with
52 additions
and
1 deletions
autofiles.sums
| 1 | -1644769c53aa0f44d2957ec4da300da1b184452abbf5bd3c280bcd01958d5c04 configure.ac | 1 | +d6ab690ff0a692fae861cf77ede19245aa2e60bff561846085473ad7060df157 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
| @@ -767,6 +767,7 @@ enable_largefile | @@ -767,6 +767,7 @@ enable_largefile | ||
| 767 | enable_ld_version_script | 767 | enable_ld_version_script |
| 768 | with_buildrules | 768 | with_buildrules |
| 769 | enable_werror | 769 | enable_werror |
| 770 | +enable_int_warnings | ||
| 770 | enable_test_compare_images | 771 | enable_test_compare_images |
| 771 | enable_show_failed_test_output | 772 | enable_show_failed_test_output |
| 772 | with_docbook_xsl | 773 | with_docbook_xsl |
| @@ -1438,6 +1439,8 @@ Optional Features: | @@ -1438,6 +1439,8 @@ Optional Features: | ||
| 1438 | --enable-ld-version-script | 1439 | --enable-ld-version-script |
| 1439 | enable linker version script (default is enabled) | 1440 | enable linker version script (default is enabled) |
| 1440 | --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 | ||
| 1443 | + no) | ||
| 1441 | --enable-test-compare-images | 1444 | --enable-test-compare-images |
| 1442 | whether to compare images in test suite; disabled by | 1445 | whether to compare images in test suite; disabled by |
| 1443 | default, enabling requires ghostscript and tiffcmp | 1446 | default, enabling requires ghostscript and tiffcmp |
| @@ -16683,6 +16686,33 @@ else | @@ -16683,6 +16686,33 @@ else | ||
| 16683 | $as_echo "no" >&6; } | 16686 | $as_echo "no" >&6; } |
| 16684 | fi | 16687 | fi |
| 16685 | 16688 | ||
| 16689 | +if test "$BUILDRULES" = "msvc"; then | ||
| 16690 | + try_flags="-W3" | ||
| 16691 | +else | ||
| 16692 | + try_flags="-Wconversion -Wsign-conversion" | ||
| 16693 | +fi | ||
| 16694 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use $try_flags" >&5 | ||
| 16695 | +$as_echo_n "checking for whether to use $try_flags... " >&6; } | ||
| 16696 | +# Check whether --enable-int-warnings was given. | ||
| 16697 | +if test "${enable_int_warnings+set}" = set; then : | ||
| 16698 | + enableval=$enable_int_warnings; if test "$enableval" = "yes"; then | ||
| 16699 | + qpdf_INT_WARNINGS=1; | ||
| 16700 | + else | ||
| 16701 | + qpdf_INT_WARNINGS=0; | ||
| 16702 | + fi | ||
| 16703 | +else | ||
| 16704 | + qpdf_INT_WARNINGS=0 | ||
| 16705 | +fi | ||
| 16706 | + | ||
| 16707 | +if test "$qpdf_INT_WARNINGS" = "1"; then | ||
| 16708 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
| 16709 | +$as_echo "yes" >&6; } | ||
| 16710 | + WFLAGS="$WFLAGS $try_flags" | ||
| 16711 | +else | ||
| 16712 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
| 16713 | +$as_echo "no" >&6; } | ||
| 16714 | +fi | ||
| 16715 | + | ||
| 16686 | 16716 | ||
| 16687 | # Check whether --enable-test-compare-images was given. | 16717 | # Check whether --enable-test-compare-images was given. |
| 16688 | if test "${enable_test_compare_images+set}" = set; then : | 16718 | if test "${enable_test_compare_images+set}" = set; then : |
configure.ac
| @@ -392,6 +392,27 @@ else | @@ -392,6 +392,27 @@ else | ||
| 392 | AC_MSG_RESULT(no) | 392 | AC_MSG_RESULT(no) |
| 393 | fi | 393 | fi |
| 394 | 394 | ||
| 395 | +if test "$BUILDRULES" = "msvc"; then | ||
| 396 | + try_flags="-W3" | ||
| 397 | +else | ||
| 398 | + try_flags="-Wconversion -Wsign-conversion" | ||
| 399 | +fi | ||
| 400 | +AC_MSG_CHECKING(for whether to use $try_flags) | ||
| 401 | +AC_ARG_ENABLE(int-warnings, | ||
| 402 | + AS_HELP_STRING([--enable-int-warnings], | ||
| 403 | + [whether to turn on integer type warnings (default is no)]), | ||
| 404 | + [if test "$enableval" = "yes"; then | ||
| 405 | + qpdf_INT_WARNINGS=1; | ||
| 406 | + else | ||
| 407 | + qpdf_INT_WARNINGS=0; | ||
| 408 | + fi], [qpdf_INT_WARNINGS=0]) | ||
| 409 | +if test "$qpdf_INT_WARNINGS" = "1"; then | ||
| 410 | + AC_MSG_RESULT(yes) | ||
| 411 | + WFLAGS="$WFLAGS $try_flags" | ||
| 412 | +else | ||
| 413 | + AC_MSG_RESULT(no) | ||
| 414 | +fi | ||
| 415 | + | ||
| 395 | AC_SUBST(QPDF_SKIP_TEST_COMPARE_IMAGES) | 416 | AC_SUBST(QPDF_SKIP_TEST_COMPARE_IMAGES) |
| 396 | AC_ARG_ENABLE(test-compare-images, | 417 | AC_ARG_ENABLE(test-compare-images, |
| 397 | AS_HELP_STRING([--enable-test-compare-images], | 418 | AS_HELP_STRING([--enable-test-compare-images], |