1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01:00

Merge pull request #8157 from hercules-ci/switch-bugs

Fix current and future `switch` bugs
This commit is contained in:
Théophane Hufschmitt 2023-04-03 20:43:02 +02:00 committed by GitHub
commit 523c3f7225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 42 additions and 11 deletions

View file

@ -65,9 +65,10 @@ public:
switch (lvl) {
case lvlError: c = '3'; break;
case lvlWarn: c = '4'; break;
case lvlInfo: c = '5'; break;
case lvlNotice: case lvlInfo: c = '5'; break;
case lvlTalkative: case lvlChatty: c = '6'; break;
default: c = '7';
case lvlDebug: case lvlVomit: c = '7';
default: c = '7'; break; // should not happen, and missing enum case is reported by -Werror=switch-enum
}
prefix = std::string("<") + c + ">";
}