Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings when compiling with GCC 13.2 #60

Open
FitzRoyX opened this issue Apr 11, 2024 · 1 comment
Open

Warnings when compiling with GCC 13.2 #60

FitzRoyX opened this issue Apr 11, 2024 · 1 comment

Comments

@FitzRoyX
Copy link

In file included from ../thirdparty/ymfm/src/ymfm_opl.cpp:32:
../thirdparty/ymfm/src/ymfm_fm.ipp: In member function 'void ymfm::fm_engine_base<RegisterType>::engine_timer_expired(uint32_t) [with RegisterType = ymfm::opl_registers_base<3>]':
../thirdparty/ymfm/src/ymfm_fm.ipp:1523:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 1523 |         m_timer_running[tnum] = false;
      |         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from ../thirdparty/ymfm/src/ymfm_opl.h:38,
                 from ../thirdparty/ymfm/src/ymfm_opl.cpp:31:
../thirdparty/ymfm/src/ymfm_fm.h:448:17: note: at offset 2 into destination object 'ymfm::fm_engine_base<ymfm::opl_registers_base<3> >::m_timer_running' of size 2
  448 |         uint8_t m_timer_running[2];      // current timer running state
      |                 ^~~~~~~~~~~~~~~
Compiling thirdparty/ymfm/src/ymfm_pcm.cpp ...
../thirdparty/ymfm/src/ymfm_fm.ipp: In member function 'void ymfm::fm_engine_base<RegisterType>::engine_timer_expired(uint32_t) [with RegisterType = ymfm::opl_registers_base<4>]':
../thirdparty/ymfm/src/ymfm_fm.ipp:1523:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 1523 |         m_timer_running[tnum] = false;
      |         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../thirdparty/ymfm/src/ymfm_fm.h:448:17: note: at offset 2 into destination object 'ymfm::fm_engine_base<ymfm::opl_registers_base<4> >::m_timer_running' of size 2
  448 |         uint8_t m_timer_running[2];      // current timer running state
      |                 ^~~~~~~~~~~~~~~
In file included from ../thirdparty/ymfm/src/ymfm_opq.cpp:32:
../thirdparty/ymfm/src/ymfm_fm.ipp: In member function 'void ymfm::fm_engine_base<RegisterType>::engine_timer_expired(uint32_t) [with RegisterType = ymfm::opq_registers]':
../thirdparty/ymfm/src/ymfm_fm.ipp:1523:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 1523 |         m_timer_running[tnum] = false;
      |         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from ../thirdparty/ymfm/src/ymfm_opq.h:37,
                 from ../thirdparty/ymfm/src/ymfm_opq.cpp:31:
../thirdparty/ymfm/src/ymfm_fm.h:448:17: note: at offset 2 into destination object 'ymfm::fm_engine_base<ymfm::opq_registers>::m_timer_running' of size 2
  448 |         uint8_t m_timer_running[2];      // current timer running state
      |                 ^~~~~~~~~~~~~~~
@aaronsgiles
Copy link
Owner

These warnings don't appear to be caused by YMFM, but rather by your external engine's code.

m_timer_running is 2 entries long. The function GCC is complaining about is only ever called by your engine.

The only way I can see the "note: at offset 2 into destination object" occurring is if there is some code path where you are calling engine_timer_expired with a value of 2. Only 0 or 1 are valid.

And yes, I should probably add an assert there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants