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 9 -Warray-bounds warnings about memset() in generated code #7913

Merged
merged 1 commit into from Sep 29, 2020

Conversation

vesavlad
Copy link
Contributor

Starting with gcc9 the compilation of generated message classes throws the following error:
warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ offset [29, 32] from the object at ‘_Message1_default_instance_’ is out of the bounds of referenced subobject ‘Message1::a_’ with type ‘int’ at offset 24 [-Warray-bounds] 71 | return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This fix aims to remove this warning and also maintain backwards compatibility with older compilers, therefore fixing the #7140 issue

@acozzette
Copy link
Member

Thanks, @vesavlad.

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

Successfully merging this pull request may close these issues.

None yet

4 participants