Warnings during make

2024-01-28 Thread Jean-Charles Malahieude

On a fresh repo, as of cf3b8d901949a4a6d811755ec8d6afa2a1f5a067
the build is successful, but:

Making lily/out/main.o < cc
main.cc: In function 'void parse_argv(int, char**)':
main.cc:641:23: warning: loop variable 'keyval' creates a copy from type 
'const std::pair, 
std::__cxx11::basic_string >' [-Wrange-loop-construct]

  641 |   for (const auto keyval : init_scheme_variables_global)
  |   ^~
main.cc:641:23: note: use reference type to prevent copying
  641 |   for (const auto keyval : init_scheme_variables_global)
  |   ^~
  |   &

[...]

Making lily/out/program-option-scheme.o < cc
program-option-scheme.cc: In function 'scm_unused_struct* 
ly_command_line_options()':
program-option-scheme.cc:423:19: warning: loop variable 'keyval' creates 
a copy from type 'const std::pair, 
std::__cxx11::basic_string >' [-Wrange-loop-construct]

  423 |   for (const auto keyval : init_scheme_variables_global)
  |   ^~
program-option-scheme.cc:423:19: note: use reference type to prevent copying
  423 |   for (const auto keyval : init_scheme_variables_global)
  |   ^~
  |   &



Re: Warnings during make

2024-01-29 Thread Werner LEMBERG
> main.cc:641:23: warning: loop variable 'keyval' creates a copy from
> type 'const std::pair,
> std::__cxx11::basic_string >' [-Wrange-loop-construct]
>   641 |   for (const auto keyval : init_scheme_variables_global)
>   |   ^~
> main.cc:641:23: note: use reference type to prevent copying
>   641 |   for (const auto keyval : init_scheme_variables_global)
>   |   ^~
>   |   &

Thanks for the report.  The fixes suggested by the compiler are now
this MR.

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2250


Werner