mirror of
https://github.com/NixOS/nix
synced 2024-09-19 23:03:53 -04:00
Merge pull request #10074 from lf-/jade/ban-implicit-fallthrough
Warn on implicit switch case fallthrough
This commit is contained in:
commit
21282c3c20
2
Makefile
2
Makefile
|
@ -81,7 +81,7 @@ ifdef HOST_WINDOWS
|
||||||
GLOBAL_LDFLAGS += -Wl,--export-all-symbols
|
GLOBAL_LDFLAGS += -Wl,--export-all-symbols
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GLOBAL_CXXFLAGS += -g -Wall -include $(buildprefix)config.h -std=c++2a -I src
|
GLOBAL_CXXFLAGS += -g -Wall -Wimplicit-fallthrough -include $(buildprefix)config.h -std=c++2a -I src
|
||||||
|
|
||||||
# Include the main lib, causing rules to be defined
|
# Include the main lib, causing rules to be defined
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,9 @@ static StringToken unescapeStr(SymbolTable & symbols, char * s, size_t length)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// yacc generates code that uses unannotated fallthrough.
|
||||||
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||||
|
|
||||||
#define YY_USER_INIT initLoc(yylloc)
|
#define YY_USER_INIT initLoc(yylloc)
|
||||||
#define YY_USER_ACTION adjustLoc(yylloc, yytext, yyleng);
|
#define YY_USER_ACTION adjustLoc(yylloc, yytext, yyleng);
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ void copyRecursive(
|
||||||
case SourceAccessor::tSymlink:
|
case SourceAccessor::tSymlink:
|
||||||
{
|
{
|
||||||
sink.createSymlink(to, accessor.readLink(from));
|
sink.createSymlink(to, accessor.readLink(from));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SourceAccessor::tRegular:
|
case SourceAccessor::tRegular:
|
||||||
|
@ -38,6 +39,7 @@ void copyRecursive(
|
||||||
sink, to + "/" + name);
|
sink, to + "/" + name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SourceAccessor::tMisc:
|
case SourceAccessor::tMisc:
|
||||||
|
|
Loading…
Reference in a new issue