Skip to content

Compiler warnings in In constructor ‘Log_event::Log_event(...) #706

Description

@VARGA-Peter

MySQL version / commit

26.7

Steps to reproduce

Compiling MySQL 26.7.0 produces these warnings - maybe, the compiler doesn't see the correct path, but this shouldn't happen:

In constructor ‘Log_event::Log_event(mysql::binlog::event::Log_event_header*, mysql::binlog::event::Log_event_footer*)’,
    inlined from ‘Rows_log_event::Rows_log_event(const char*, const mysql::binlog::event::Format_description_event*)’ at /builds/mysql-server-trunk-26.7.0./sql/log_event.cc:7858:25:
/builds/mysql-server-trunk-26.7.0./sql/log_event.cc:973:30: warning: ‘((mysql::binlog::event::Log_event_header*)this)[7].mysql::binlog::event::Log_event_header::unmasked_server_id’ is used uninitialized [-Wuninitialized]
  973 |   server_id = common_header->unmasked_server_id & opt_server_id_mask;
      |               ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /builds/mysql-server-trunk-26.7.0./sql/log_event.h:56,
                 from /builds/mysql-server-trunk-26.7.0./sql/log_event.cc:27:
In member function ‘bool mysql::binlog::event::Log_event_header::get_is_valid()’,
    inlined from ‘bool Log_event::is_valid()’ at /builds/mysql-server-trunk-26.7.0./sql/log_event.cc:1312:65,
    inlined from ‘Rows_log_event::Rows_log_event(const char*, const mysql::binlog::event::Format_description_event*)’ at /builds/mysql-server-trunk-26.7.0./sql/log_event.cc:7870:16:
/builds/mysql-server-trunk-26.7.0./libs/mysql/binlog/event/binlog_event.h:750:32: warning: ‘((mysql::binlog::event::Log_event_header*)this)[7].mysql::binlog::event::Log_event_header::m_is_valid’ is used uninitialized [-Wuninitialized]
  750 |   bool get_is_valid() { return m_is_valid; }
      |                                ^~~~~~~~~~
/builds/mysql-server-trunk-26.7.0./sql/log_event.cc: In constructor ‘Rows_log_event::Rows_log_event(const char*, const mysql::binlog::event::Format_description_event*)’:
/builds/mysql-server-trunk-26.7.0./sql/log_event.cc:7895:27: warning: ‘((mysql::binlog::event::Rows_event*)((char*)this + 64))[1].mysql::binlog::event::Rows_event::m_width’ may be used uninitialized [-Wmaybe-uninitialized]
 7895 |                           m_width))) {
      |                           ^~~~~~~

Expected vs actual result

No warnings.

Platform / compiler

SLES 15.7, gcc 15

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions