Skip to content

goto-cc: Fix compilation with GCC 11 #6032

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

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

vmihalko
Copy link
Contributor

The reference type caused following error:
/builddir/build/BUILD/cbmc/src/goto-cc/ms_link_cmdline.cpp:337:26: error: loop variable 'ms_link_option' of type 'const string&' {aka 'const std::__cxx11::basic_string&'} binds to a temporary constructed from type 'const char*' [-Werror=range-loop-construct]
337 | for(const std::string &ms_link_option : ms_link_options)
| ^~~~~~~~~~~~~~
/builddir/build/BUILD/cbmc/src/goto-cc/ms_link_cmdline.cpp:337:26: note: use non-reference type 'const string' {aka 'const std::__cxx11::basic_string'} to make the copy explicit or 'const char* const&' to prevent copying

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

The reference type caused following error:
/builddir/build/BUILD/cbmc/src/goto-cc/ms_link_cmdline.cpp:337:26: error: loop variable 'ms_link_option' of type 'const string&' {aka 'const std::__cxx11::basic_string<char>&'} binds to a temporary constructed from type 'const char*' [-Werror=range-loop-construct]
  337 |   for(const std::string &ms_link_option : ms_link_options)
      |                          ^~~~~~~~~~~~~~
/builddir/build/BUILD/cbmc/src/goto-cc/ms_link_cmdline.cpp:337:26: note: use non-reference type 'const string' {aka 'const std::__cxx11::basic_string<char>'} to make the copy explicit or 'const char* const&' to prevent copying
@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #6032 (9db8e6c) into develop (eea16dd) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6032      +/-   ##
===========================================
+ Coverage    74.11%   74.12%   +0.01%     
===========================================
  Files         1444     1444              
  Lines       157389   157389              
===========================================
+ Hits        116646   116664      +18     
+ Misses       40743    40725      -18     
Impacted Files Coverage Δ
src/goto-cc/ms_link_cmdline.cpp 0.00% <0.00%> (ø)
src/ansi-c/parser.y 61.00% <0.00%> (+0.06%) ⬆️
src/ansi-c/c_typecheck_expr.cpp 60.09% <0.00%> (+0.29%) ⬆️
src/ansi-c/c_typecheck_code.cpp 70.14% <0.00%> (+0.72%) ⬆️
src/ansi-c/literals/convert_character_literal.cpp 51.21% <0.00%> (+19.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eea16dd...9db8e6c. Read the comment docs.

@kroening kroening merged commit e2d227f into diffblue:develop Apr 13, 2021
@vmihalko vmihalko deleted the bad_ref_type branch April 14, 2021 18:54
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.

3 participants