[06/29] Remove NR_DOMAINS

Message ID 20231120-submit-domain-hacks-2-v1-6-29650d01b198@tromey.com
State New
Headers
Series Restructure symbol domains |

Commit Message

Tom Tromey Nov. 21, 2023, 3:53 a.m. UTC
  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 | 4 ----
 1 file changed, 4 deletions(-)
  

Patch

diff --git a/gdb/symtab.h b/gdb/symtab.h
index 8dfc873b1c9..21c84cbe006 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -916,15 +916,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
-gdb_static_assert (NR_DOMAINS <= (1 << SYMBOL_DOMAIN_BITS));
 
 extern const char *domain_name (domain_enum);