[build] handle fallthru warning in flight plans due to NextStage

This commit is contained in:
Gautier Hattenberger
2018-02-08 17:25:09 +01:00
parent 3989057fe9
commit f1c3753352
2 changed files with 10 additions and 4 deletions
@@ -43,16 +43,16 @@ void nav_goto_block(uint8_t block_id);
#define InitStage() nav_init_stage();
#define Block(x) /* Falls through. */ case x: nav_block=x;
#define Block(x) case x: nav_block=x;
#define NextBlock() nav_goto_block(nav_block + 1)
#define GotoBlock(b) nav_goto_block(b)
#define Stage(s) /* Falls through. */ case s: nav_stage=s;
#define NextStage() { nav_stage++; InitStage(); }
#define Stage(s) case s: nav_stage=s;
#define NextStage() { nav_stage++; InitStage(); } INTENTIONAL_FALLTHRU
#define NextStageAndBreak() { nav_stage++; InitStage(); break; }
#define NextStageAndBreakFrom(wp) { last_wp = wp; NextStageAndBreak(); }
#define Label(x) /* Falls through. */ label_ ## x:
#define Label(x) label_ ## x:
#define Goto(x) { goto label_ ## x; }
#define Return(x) { nav_block=last_block; if (x==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}
+6
View File
@@ -235,4 +235,10 @@ static inline bool str_equal(const char *a, const char *b)
# define WEAK
#endif
#if __GNUC__ >= 7
# define INTENTIONAL_FALLTHRU __attribute__ ((fallthrough));
#else
# define INTENTIONAL_FALLTHRU
#endif
#endif /* STD_H */