From af754e596a8dbb05ed8580c342e7fe02e08b28e0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:11:00 +0200 Subject: Adding upstream version 3.2.3+dfsg. Signed-off-by: Daniel Baumann --- m4/fr_have_bounded_attribute.m4 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 m4/fr_have_bounded_attribute.m4 (limited to 'm4/fr_have_bounded_attribute.m4') diff --git a/m4/fr_have_bounded_attribute.m4 b/m4/fr_have_bounded_attribute.m4 new file mode 100644 index 0000000..50c3305 --- /dev/null +++ b/m4/fr_have_bounded_attribute.m4 @@ -0,0 +1,26 @@ +dnl # +dnl # Check if we have __attribute__((__bounded__)) (usually only OpenBSD with GCC) +dnl # +AC_DEFUN([FR_HAVE_BOUNDED_ATTRIBUTE],[ + AC_CACHE_CHECK([for __attribute__((__bounded__)) support in compiler], [ax_cv_cc_bounded_attribute],[ + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror" + AC_RUN_IFELSE( + [ + AC_LANG_SOURCE([ + void test(char *buff) __attribute__ ((__bounded__ (__string__, 1, 1))); + int main(int argc, char **argv) { + if ((argc < 0) || !argv) return 1; /* -Werror=unused-parameter */ + return 0; + } + ]) + ], + [ax_cv_cc_bounded_attribute=yes], + [ax_cv_cc_bounded_attribute=no] + ) + CFLAGS="$CFLAGS_SAVED" + ]) + if test "x$ax_cv_cc_bounded_attribute" = "xyes"; then + AC_DEFINE(HAVE_ATTRIBUTE_BOUNDED, 1, [Define if your compiler supports the __bounded__ attribute (usually OpenBSD gcc).]) + fi +]) -- cgit v1.2.3