aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-04-03 18:11:42 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-04-03 18:45:20 +0200
commitfba7be80eb0fab54b570623d3991739cf3da0759 (patch)
tree5d1e6a52ebf94fa353d29dfec6a7cf49b8f27d37 /src/libexpr
parent9470ee877dabcf133469467a23649066e2bcce5c (diff)
Enable -Werror=switch-enum
switch statements must now match all enum values or disable the warning. Explicit is good. This has helped us find two bugs, after solving another one by debugging. From now on, adding to an enum will raise errors where they are not explicitly handled, which is good for productivity, and helps us decide the correct behavior in all usages. Notably still excluded from this though are the cases where the warning is disabled by local pragmas. fromTOML.cc did not build despite a top-level pragma, so I've had to resort to a makefile solution for that.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/local.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/local.mk b/src/libexpr/local.mk
index 2171e769b..d243b9cec 100644
--- a/src/libexpr/local.mk
+++ b/src/libexpr/local.mk
@@ -46,3 +46,5 @@ $(foreach i, $(wildcard src/libexpr/flake/*.hh), \
$(d)/primops.cc: $(d)/imported-drv-to-derivation.nix.gen.hh $(d)/primops/derivation.nix.gen.hh $(d)/fetchurl.nix.gen.hh
$(d)/flake/flake.cc: $(d)/flake/call-flake.nix.gen.hh
+
+src/libexpr/primops/fromTOML.o: ERROR_SWITCH_ENUM =