]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove NR_DOMAINS
authorTom Tromey <tom@tromey.com>
Thu, 2 Mar 2023 22:08:42 +0000 (15:08 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 28 Jan 2024 17:58:16 +0000 (10:58 -0700)
NR_DOMAINS is only used for a static assert, but we no longer need it
now.  If we add too many constants to this enum, GCC will warn about
the bitfield overflow:

    error: ‘symbol::m_domain’ is too small to hold all values of ‘enum domain_enum’

gdb/symtab.h

index 729c003f1c10308574671f7c66ccc557d7794c7e..6b5b087e99a028ec8e71ff756f2f9d7e904d4f60 100644 (file)
@@ -922,15 +922,11 @@ enum domain_enum
   /* Fortran common blocks.  Their naming must be separate from VAR_DOMAIN.
      They also always use LOC_COMMON_BLOCK.  */
   COMMON_BLOCK_DOMAIN,
-
-  /* This must remain last.  */
-  NR_DOMAINS
 };
 
 /* The number of bits in a symbol used to represent the domain.  */
 
 #define SYMBOL_DOMAIN_BITS 3
-static_assert (NR_DOMAINS <= (1 << SYMBOL_DOMAIN_BITS));
 
 extern const char *domain_name (domain_enum);