Skip to content

Conversation

@laurynas-biveinis
Copy link
Contributor

This fixes

mysys/charset.cc: In member function 'virtual int MY_CHARSET_LOADER::add_collation(CHARSET_INFO*)':
mysys/charset.cc:232:13: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct CHARSET_INFO' with no trivial copy-assignment; use value-initialization instead [-Werror=class-memaccess]
232 | memset(all_charsets[cs->number], 0, sizeof(CHARSET_INFO));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mysys/charset.cc:43:
include/m_ctype.h:383:8: note: 'struct CHARSET_INFO' declared here
383 | struct CHARSET_INFO {
| ^~~~~~~~~~~~

Fix by removing memset and passing MY_ZEROFILL flag to the allocation function
instead.

Squash with 6637b51

This fixes

mysys/charset.cc: In member function 'virtual int MY_CHARSET_LOADER::add_collation(CHARSET_INFO*)':
mysys/charset.cc:232:13: error: 'void* memset(void*, int, size_t)' clearing an object of type 'struct CHARSET_INFO' with no trivial copy-assignment; use value-initialization instead [-Werror=class-memaccess]
  232 |       memset(all_charsets[cs->number], 0, sizeof(CHARSET_INFO));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mysys/charset.cc:43:
include/m_ctype.h:383:8: note: 'struct CHARSET_INFO' declared here
  383 | struct CHARSET_INFO {
      |        ^~~~~~~~~~~~

Fix by removing memset and passing MY_ZEROFILL flag to the allocation function
instead.

Squash with 6637b51
@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

This pull request has been merged in 02369bd.

@laurynas-biveinis laurynas-biveinis deleted the gcc-11-fix branch October 7, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants