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

Various build warnings (treated as errors): error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call] #3386

Closed
dholbert opened this issue Oct 23, 2022 · 3 comments · May be fixed by #3387

Comments

@dholbert
Copy link
Contributor

When building rr with Ubuntu clang version 15.0.2-1 on Ubuntu 22.10, I get the following warnings (treated as errors):

rr/src/AddressSpace.cc:212:24: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
      mapped_file_stat(move(mapped_file_stat)),
                       ^
                       std::
rr/src/AddressSpace.cc:214:31: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
      monitored_shared_memory(move(monitored)),
                              ^
                              std::
rr/src/AddressSpace.cc:777:57: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
  map_and_coalesce(t, m, actual_recorded_map, emu_file, move(mapped_file_stat),
                                                        ^
                                                        std::
rr/src/AddressSpace.cc:778:20: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                   move(local_addr), move(monitored));
                   ^
                   std::
rr/src/AddressSpace.cc:778:38: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                   move(local_addr), move(monitored));
                                     ^
                                     std::
rr/src/AddressSpace.cc:893:17: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
    Mapping m = move(mm);
                ^
                std::
rr/src/AddressSpace.cc:920:11: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
          move(monitored));
          ^
          std::
rr/src/AddressSpace.cc:1298:17: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
    Mapping m = move(mm);
                ^
                std::
rr/src/AddressSpace.cc:1310:39: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                        m.local_addr, move(monitored));
                                      ^
                                      std::
rr/src/AddressSpace.cc:1543:23: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
    Mapping mapping = move(mm);
                      ^
                      std::
rr/src/AddressSpace.cc:2066:45: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
      m, Mapping(m, recorded_map, emu_file, move(mapped_file_stat), local_addr,
                                            ^
                                            std::
rr/src/AddressSpace.cc:2067:18: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                 move(monitored))));
                 ^
                 std::
rr/src/Dwarf.cc:201:43: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
    abbrevs.insert(make_pair(abbrev_code, move(abbrev)));
                                          ^
                                          std::
rr/src/Dwarf.cc:218:36: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
  abbrevs.insert(make_pair(offset, move(set)));
                                   ^
                                   std::

This building is new to me so I'm not sure about the reasoning behind it, but it looks like it's addressed by adding std:: prefix on all move invocations.

(This is needed even despite using namespace std; at the top of the file -- maybe for disambiguation, in case a project ever gets a move symbol from some other namespace? Not sure.)

@dholbert
Copy link
Contributor Author

(The above are just the first instances of this issue that I hit, which I patched by hand. There are additional warnings further into the build for ExportImportCheckpoints.cc and GdbServer.cc and GdbExpression.cc and GdbConnection.cc, at least.)

dholbert added a commit to dholbert/rr that referenced this issue Oct 23, 2022
…ified-std-cast-call build warning.

This fixes rr-debugger#3386.

In a few cases this patch also rewraps the affected line, aiming to roughly
preserve the prior line length and optimize for readability.
@dholbert
Copy link
Contributor Author

Fix posted in #3387,

@dholbert
Copy link
Contributor Author

(I confirmed that I can build successfully with that pull request's commit.)

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