fix(3p/nix): Fix all remaining compiler warnings

This compiles under `-Wall -Werror`.

The largest chunk of this change is `final` qualifiers for the various
Nix CLI command structs, which inherit from a Command class that has
more virtual functions than are implemented by each command.

Change-Id: I0925e6e1a39013f026773db5816e4a77d50f3b4a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1294
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
This commit is contained in:
Vincent Ambo 2020-07-19 21:52:35 +01:00 committed by tazjin
parent ca50fb66d2
commit 15afa8472e
33 changed files with 66 additions and 39 deletions

View file

@ -34,6 +34,15 @@ struct ParseData : public gc {
sLetBody(symbols.Create("<let-body>")){};
};
// Clang fails to identify these functions as used, probably because
// of some interaction between the lexer/parser codegen and something
// else.
//
// To avoid warnings for that we disable -Wunused-function in this block.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
// TODO(tazjin): move dupAttr to anonymous namespace
static void dupAttr(const AttrPath& attrPath, const Pos& pos,
const Pos& prevPos) {
@ -85,4 +94,6 @@ static Expr* unescapeStr(SymbolTable& symbols, const char* s, size_t length) {
return new ExprString(symbols.Create(t));
}
#pragma clang diagnostic pop // re-enable -Wunused-function
} // namespace nix