File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed
Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ ## enablewarnings
2+
3+ Test [ ` enablewarnings ` ] ( https://premake.github.io/docs/enablewarnings )
Original file line number Diff line number Diff line change 1+ if (_ACTION == nil ) then
2+ return
3+ end
4+
5+ local LocationDir = " solution/%{_ACTION}"
6+
7+ workspace " Project"
8+ location (LocationDir )
9+ configurations {" Debug" , " Release" }
10+
11+ objdir (path .join (LocationDir , " obj" )) -- premake adds $(configName)/$(AppName)
12+ targetdir (path .join (LocationDir , " bin/%{cfg.buildcfg}" ))
13+ startproject " app"
14+
15+ project " app"
16+ kind " ConsoleApp"
17+ targetname " app"
18+
19+ files { " src/main.cpp" }
20+
21+ fatalwarnings " All"
22+
23+ filter " toolset:msc*"
24+ enablewarnings {
25+ " 4061" , -- enumerator '%identifier' in a switch of enum '%enum' is not explicitly handled by a case label
26+ " 4062" , -- enumerator '%identifier' in a switch of enum '%enum' is not handled
27+ }
28+ filter " toolset:not msc*"
29+ enablewarnings {
30+ " switch"
31+ }
32+ filter {}
Original file line number Diff line number Diff line change 1+ enum E
2+ {
3+ A,
4+ B
5+ };
6+
7+
8+ void foo (E e) {
9+ switch (e) {
10+ case E::A: break ;
11+ // missing case E::B
12+ }
13+ }
14+
15+ int main ()
16+ {
17+ }
You can’t perform that action at this time.
0 commit comments