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

Fix GCC build regression #1491

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants