diff options
author | Guy Harris <gharris@sonic.net> | 2021-07-25 03:00:36 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-07-25 03:00:36 -0700 |
commit | a4e7bf58bc36ee9ffa6849741ce0936ead02e106 (patch) | |
tree | 84b2ec3f199d25786dcd3203197d08e7def2e572 /configure | |
parent | 8336c296aff1e7cd0172704ae0e11dd2dc275383 (diff) | |
download | libpcap-a4e7bf58bc36ee9ffa6849741ce0936ead02e106.tar.gz |
configure: use AC_COMPILE_IFELSE() and AC_LANG_SOURCE() for testing flags.
That lets us completely control the program that's compiled with the
compiler flag we're testing, so we can make it a minimal program that
uses only prototype declarations and that therefore won't generate
warnings with some -W flags, e.g. -Wold-style-definition, and thus won't
falsely report those flags as unsupported.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 960 |
1 files changed, 240 insertions, 720 deletions
@@ -3868,47 +3868,23 @@ $as_echo_n "checking whether the compiler supports the -fvisibility=hidden optio save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int - # main () - # { + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -4001,47 +3977,23 @@ $as_echo_n "checking whether the compiler supports the -fvisibility=hidden optio save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int main(void) { return 0; }. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -4196,47 +4148,23 @@ $as_echo_n "checking whether the compiler supports the -xldscope=hidden option.. save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -9483,47 +9411,23 @@ $as_echo_n "checking whether the compiler supports the -W option... " >&6; } save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -9598,47 +9502,23 @@ $as_echo_n "checking whether the compiler supports the -Wall option... " >&6; } save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # ; - # return 0; - # } + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -9713,47 +9593,23 @@ $as_echo_n "checking whether the compiler supports the -Wcomma option... " >&6; save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int - # main () - # { + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -9828,47 +9684,23 @@ $as_echo_n "checking whether the compiler supports the -Wdocumentation option... save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int main(void) { return 0; }. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -9943,47 +9775,23 @@ $as_echo_n "checking whether the compiler supports the -Wformat-nonliteral optio save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10058,47 +9866,23 @@ $as_echo_n "checking whether the compiler supports the -Wmissing-noreturn option save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10173,47 +9957,23 @@ $as_echo_n "checking whether the compiler supports the -Wmissing-prototypes opti save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # ; - # return 0; - # } + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10288,47 +10048,23 @@ $as_echo_n "checking whether the compiler supports the -Wmissing-variable-declar save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int - # main () - # { + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10403,47 +10139,23 @@ $as_echo_n "checking whether the compiler supports the -Wpointer-arith option... save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int main(void) { return 0; }. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10518,47 +10230,23 @@ $as_echo_n "checking whether the compiler supports the -Wpointer-sign option... save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10633,47 +10321,23 @@ $as_echo_n "checking whether the compiler supports the -Wshadow option... " >&6; save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10748,47 +10412,23 @@ $as_echo_n "checking whether the compiler supports the -Wsign-compare option... save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # ; - # return 0; - # } + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10863,47 +10503,23 @@ $as_echo_n "checking whether the compiler supports the -Wstrict-prototypes optio save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int - # main () - # { + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -10978,47 +10594,23 @@ $as_echo_n "checking whether the compiler supports the -Wunused-parameter option save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # int main(void) { return 0; }. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -11093,47 +10685,23 @@ $as_echo_n "checking whether the compiler supports the -Wused-but-marked-unused save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } - # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -11235,47 +10803,23 @@ $as_echo_n "checking whether the compiler supports the -Wunreachable-code option save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { - # - # ; - # return 0; - # } + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -11357,47 +10901,23 @@ $as_echo_n "checking whether the compiler supports the -Wshorten-64-to-32 option save_ac_c_werror_flag="$ac_c_werror_flag" ac_c_werror_flag=yes # - # XXX - with autoconf 2.69, at least, the test program that this - # tries to compile is: - # - # int - # main () - # { + # We use AC_LANG_SOURCE() so that we can control the complete + # content of the program being compiled. We do not, for example, + # want the default "int main()" that AC_LANG_PROGRAM() generates, + # as it will generate a warning with -Wold-style-definition, meaning + # that we would treat it as not working, as the test will fail if + # *any* error output, including a warning due to the flag we're + # testing, is generated; see # - # ; - # return 0; - # } + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us + # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us # - # Hopefully, neither the empty statement nor the old-style - # definition of main() will, with any command-line flag - # whatsoever with which we test, on any compiler we test, - # will produce any warnings whatsoever; if it does, the - # command-line flag with which we test will be treated as - # not being supported even if it is supported. - # - # Thanks, autoconf, for making it *so* difficult to generate - # an absolute minimum valid C-with-everything-prototyped - # program as a test program, such as - # - # int main(void) { return 0; }. - # - # (with autoconf 2.69, at least, using AC_LANG_CONFTEST() with - # AC_LANG_SOURCE([<code>]) produces the same function boilerplate - # as AC_LANG_PROGRAM([],[<code>]), complete with the main() - # function wrapper, the extra semicolon, and the return 0;, - # raising the question of "why, then, do both AC_LANG_SOURCE() - # and AC_LANG_PROGRAM() exist?"). + # This may, as per those two messages, be fixed in autoonf 2.70, + # but we only require 2.64 or newer for now. # cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : |