https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127224
Bug ID: 127224
Summary: gcc_AC_C_ENUM_BF_UNSIGNED is unused and should be
removed
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: easyhack, internal-improvement
Severity: normal
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Currently configure.ac has:
dnl Disabled until we have a complete test for buggy enum bitfields.
dnl gcc_AC_C_ENUM_BF_UNSIGNED
But ENUM_BITFIELD is no longer used anyways; since the fixing of PR 125507 as
we moved over to C++.
So this should be removed from configure.ac and the corresponding
gcc_AC_C_ENUM_BF_UNSIGNED should be removed from acinclude.m4:
```
dnl Determine if enumerated bitfields are unsigned. ISO C says they can
dnl be either signed or unsigned.
dnl
AC_DEFUN([gcc_AC_C_ENUM_BF_UNSIGNED],
[AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
[AC_RUN_IFELSE([AC_LANG_SOURCE([#include <stdlib.h>
enum t { BLAH = 128 } ;
struct s_t { enum t member : 8; } s ;
int main(void)
{
s.member = BLAH;
if (s.member < 0) exit(1);
exit(0);
}])], gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no,
gcc_cv_enum_bf_unsigned=yes)])
if test $gcc_cv_enum_bf_unsigned = yes; then
AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
[Define if enumerated bitfields are treated as unsigned values.])
fi])
```