summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-06-05 07:33:13 -0600
committerKarl Williamson <khw@cpan.org>2021-06-12 09:20:14 -0600
commitbfe5127121a2046fe9d996a64635f6f08d940528 (patch)
treef624010676384b5484c0191c47b1cd430928b05b /Configure
parent19c4b24fc62a1e8dd1f7dcaaf337d0eb11dbb6b0 (diff)
downloadperl-bfe5127121a2046fe9d996a64635f6f08d940528.tar.gz
Configure changes for HAS_NON_INT_BITFIELDS
This probe has been available without my realizing it had been merged. Some compilers, chiefly IBM, use only integer-size bitfields, warning when presented with other-sized ones. Allowing other-sized fields is an extension to the C standard. These warnings don't affect the correctness of the code generated, but very many are generated per run, potentially overwhelming the reader into not noticing warnings that are important.
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure33
1 files changed, 33 insertions, 0 deletions
diff --git a/Configure b/Configure
index 46f68258a7..3bcd107065 100755
--- a/Configure
+++ b/Configure
@@ -394,6 +394,7 @@ d_attribute_unused=''
d_attribute_warn_unused_result=''
d_printf_format_null=''
d_backtrace=''
+d_non_int_bitfields=''
d_builtin_choose_expr=''
d_builtin_expect=''
d_builtin_add_overflow=''
@@ -16541,6 +16542,37 @@ eval $inhdr
set nl_langinfo d_nl_langinfo
eval $inlibc
+: Look for non 'int'-sized bitfields
+case "$d_non_int_bitfields" in
+'')
+echo " " >&4
+echo "Checking whether your compiler can handle struct bitfields that aren't 'int' or 'unsigned int' ..." >&4
+$cat >try.c <<'EOCP'
+#include <stdio.h>
+struct foo {
+ unsigned char byte:1;
+ unsigned short halfword:1;
+} bar;
+EOCP
+if $cc $ccflags -c try.c >try.out 2>&1 ; then
+ if $compiler_warning try.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support struct bitfields that aren't 'int' or 'unsigned int'." >&4
+ val="$undef"
+ else
+ echo "Your C compiler supports struct bitfields besides 'int' and 'unsigned int'." >&4
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand struct bitfields that aren't 'int' or 'unsigned int' at all." >&4
+ val="$undef"
+fi
+;;
+*) val="$d_non_int_bitfields" ;;
+esac
+set d_non_int_bitfields
+eval $setvar
+$rm_try
+
: see if this is a quadmath.h system
set quadmath.h i_quadmath
eval $inhdr
@@ -24527,6 +24559,7 @@ d_nextafter='$d_nextafter'
d_nexttoward='$d_nexttoward'
d_nice='$d_nice'
d_nl_langinfo='$d_nl_langinfo'
+d_non_int_bitfields='$d_non_int_bitfields'
d_nv_preserves_uv='$d_nv_preserves_uv'
d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
d_off64_t='$d_off64_t'