mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
fba7be80eb
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.
13 lines
432 B
Makefile
13 lines
432 B
Makefile
clean-files += Makefile.config
|
|
|
|
GLOBAL_CXXFLAGS += -Wno-deprecated-declarations -Werror=switch
|
|
# Allow switch-enum to be overridden for files that do not support it, usually because of dependency headers.
|
|
ERROR_SWITCH_ENUM = -Werror=switch-enum
|
|
|
|
$(foreach i, config.h $(wildcard src/lib*/*.hh), \
|
|
$(eval $(call install-file-in, $(i), $(includedir)/nix, 0644)))
|
|
|
|
$(GCH): src/libutil/util.hh config.h
|
|
|
|
GCH_CXXFLAGS = -I src/libutil
|