| Title | MPS does not compile with GCC 7 |
| Status | closed |
| Priority | essential |
| Assigned user | Gareth Rees |
| Organization | Ravenbrook |
| Description | With gcc 7.3.0: $ make -f xci6gc.gmk VARIETY=cool In file included from tree.h:13:0, from splay.h:13, from splay.c:18: splay.c: In function 'SplayTreeInsert': check.h:191:5: error: this statement may fall through [-Werror=implicit-fallthrough=] mps_lib_assert_fail(__FILE__, __LINE__, "unreachable code"); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ splay.c:755:5: note: in expansion of macro 'NOTREACHED' NOTREACHED; ^~~~~~~~~~ splay.c:757:3: note: here case CompareEQUAL: /* duplicate node */ ^~~~ In file included from tree.h:13:0, from splay.h:13, from splay.c:18: splay.c: In function 'SplayTreeNeighbours': check.h:191:5: error: this statement may fall through [-Werror=implicit-fallthrough=] mps_lib_assert_fail(__FILE__, __LINE__, "unreachable code"); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ splay.c:932:5: note: in expansion of macro 'NOTREACHED' NOTREACHED; ^~~~~~~~~~ splay.c:934:3: note: here case CompareEQUAL: ^~~~ In file included from tree.h:13:0, from splay.h:13, from splay.c:18: splay.c: In function 'SplayTreeNext': check.h:191:5: error: this statement may fall through [-Werror=implicit-fallthrough=] mps_lib_assert_fail(__FILE__, __LINE__, "unreachable code"); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ splay.c:1007:5: note: in expansion of macro 'NOTREACHED' NOTREACHED; ^~~~~~~~~~ splay.c:1009:3: note: here case CompareLESS: ^~~~ qs.c: In function 'scan1': qs.c:417:19: error: this statement may fall through [-Werror=implicit-fallthrough=] cell->value = addr; ~~~~~~~~~~~~^~~~~~ qs.c:420:5: note: here case QSInt: ^~~~ |
| Analysis | The warning comes from -Wextra which sets -Wimplicit-fallthrough=3 [1] which matches a comment saying /* fall through */ (or various variations) but neither /* defensive fall through */ (as in splay.c) or /* fall */ (as in qs.c). |
| How found | manual_test |
| Evidence | [1] http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html |
| Created by | Gareth Rees |
| Created on | 2018-06-21 17:18:54 |
| Last modified by | Gareth Rees |
| Last modified on | 2018-08-28 11:16:21 |
| History | 2018-06-21 GDR Created. |
| Change | Effect | Date | User | Description |
|---|---|---|---|---|
| 194064 | closed | 2018-06-21 17:38:27 | Gareth Rees | In GCC 7.3, -Wextra sets -Wimplicit-fallthough=3, which is rather strict about the format of the "fall through" comment. |