This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/81667] New: trunk/gcc/alloc-pool.h:239: possible missing initialiser ?


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81667

            Bug ID: 81667
           Summary: trunk/gcc/alloc-pool.h:239: possible missing
                    initialiser ?
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

trunk/gcc/alloc-pool.h:239]: (warning) Member variable
'base_pool_allocator::m_elt_size' is not initialized in the constructor.

Source code is

base_pool_allocator <TBlockAllocator>::base_pool_allocator (
                const char *name, size_t size MEM_STAT_DECL):
  m_name (name), m_id (0), m_elts_per_block (0), m_returned_free_list (NULL),
  m_virgin_free_list (NULL), m_virgin_elts_remaining (0), m_elts_allocated (0),
  m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL), m_size (size),
  m_initialized (false), m_location (ALLOC_POOL_ORIGIN, false PASS_MEM_STAT) {}

Probably harmless, but for belt and braces coding, it might be
wise to make sure m_elt_size is initialised in the constructor.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]