diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-08-19 11:25:24 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-08-19 11:25:24 -0700 |
commit | 3dc736d939536bcd843597cb655fcba28268705c (patch) | |
tree | 6c69e8113f12d847aa00e1c56df66c5777a43137 /configure | |
parent | 297bf6343f27ea1d18e5dad529c253ffd3935d41 (diff) | |
download | tcpdump-3dc736d939536bcd843597cb655fcba28268705c.tar.gz |
Handle attributes for function pointers by checking the compiler version.
Handle attributes for function pointers the same way we handle
attributes for functions, by explicitly checking for the compiler
version with #if rather than with a configure script check. That's one
fewer thing that, if you're not using autoconf, has to be done in some
other fashion.
While we're at it, put NORETURN in the right place to have it work with
Microsoft Visual Studio as well as various UN*X compilers.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 125 |
1 files changed, 0 insertions, 125 deletions
@@ -3670,131 +3670,6 @@ fi $as_echo "$ac_cv___attribute___unused" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((noreturn)) can be applied to function pointers without warnings" >&5 -$as_echo_n "checking whether __attribute__((noreturn)) can be applied to function pointers without warnings... " >&6; } -if ${ac_cv___attribute___noreturn_function_pointer+:} false; then : - $as_echo_n "(cached) " >&6 -else - -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include <stdlib.h> - -extern int (*foo)(int i) - __attribute__ ((noreturn)); - -int -main(int argc, char **argv) -{ - (*foo)(1); -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv___attribute___noreturn_function_pointer=yes -else - ac_cv___attribute___noreturn_function_pointer=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -CFLAGS="$save_CFLAGS" -if test "$ac_cv___attribute___noreturn_function_pointer" = "yes"; then - -$as_echo "#define __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___noreturn_function_pointer" >&5 -$as_echo "$ac_cv___attribute___noreturn_function_pointer" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((format)) can be used without warnings" >&5 -$as_echo_n "checking whether __attribute__((format)) can be used without warnings... " >&6; } -if ${ac_cv___attribute___format+:} false; then : - $as_echo_n "(cached) " >&6 -else - -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include <stdlib.h> - -extern int foo(const char *fmt, ...) - __attribute__ ((format (printf, 1, 2))); - -int -main(int argc, char **argv) -{ - foo("%s", "test"); -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv___attribute___format=yes -else - ac_cv___attribute___format=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -CFLAGS="$save_CFLAGS" -if test "$ac_cv___attribute___format" = "yes"; then - -$as_echo "#define __ATTRIBUTE___FORMAT_OK 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___format" >&5 -$as_echo "$ac_cv___attribute___format" >&6; } - - if test "$ac_cv___attribute___format" = "yes"; then - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((format)) can be applied to function pointers" >&5 -$as_echo_n "checking whether __attribute__((format)) can be applied to function pointers... " >&6; } -if ${ac_cv___attribute___format_function_pointer+:} false; then : - $as_echo_n "(cached) " >&6 -else - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include <stdlib.h> - -extern int (*foo)(const char *fmt, ...) - __attribute__ ((format (printf, 1, 2))); - -int -main(int argc, char **argv) -{ - (*foo)("%s", "test"); -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv___attribute___format_function_pointer=yes -else - ac_cv___attribute___format_function_pointer=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -if test "$ac_cv___attribute___format_function_pointer" = "yes"; then - -$as_echo "#define __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___format_function_pointer" >&5 -$as_echo "$ac_cv___attribute___format_function_pointer" >&6; } - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((fallthrough)) can be used without warnings" >&5 $as_echo_n "checking whether __attribute__((fallthrough)) can be used without warnings... " >&6; } if ${ac_cv___attribute___fallthrough+:} false; then : |