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

Fixing warnings seen when compiling with GCC using -O2 (instead of the -O3 that the build defaults to) #1570

Conversation

MasterDuke17
Copy link
Contributor

NQP builds ok and passes make m-test and Rakudo builds ok and passes make m-test m-spectest (with both GCC and Clang, and -O2 and -O3).

Otherwise GCC at the -O2 optimization level warns that `size` may be
used uninitialized.
Copy link
Contributor

@niner niner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this makes the code also easier to read.

by twice moving a conditional in MVM_string_index outside a loop, so it
won't potentially be used uninitialized. I think it couldn't actually
happen, but this is probably a little faster also.
@MasterDuke17 MasterDuke17 force-pushed the fix_warnings_found_by_gcc_at_O2_optimization_level branch from 4b6fe68 to 4293ea8 Compare October 19, 2021 12:31
@MasterDuke17 MasterDuke17 merged commit d48a5a4 into MoarVM:master Oct 19, 2021
@MasterDuke17 MasterDuke17 deleted the fix_warnings_found_by_gcc_at_O2_optimization_level branch October 19, 2021 12:32
@samcv
Copy link
Member

samcv commented Oct 20, 2021

Looks good. Thanks @MasterDuke17

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

Successfully merging this pull request may close these issues.

None yet

3 participants