| Title | MPS does not compile with -Wunreachable-code |
| Status | closed |
| Priority | nice |
| Assigned user | Gareth Rees |
| Organization | Ravenbrook |
| Description | The MPS cannot be compiled with any project that uses the -Wunreachable-code option to Clang. |
| Analysis | There are four places where unreachable code is reported: 1. protCatchThread in protxc.c 2. vmArenaExtend in areavm.c 3,4. Two uses of STATISTIC_BEGIN in poolamc.c and trace.c See [1] for more analysis. |
| How found | manual_test |
| Evidence | [1] <https://info.ravenbrook.com/mail/2014/02/24/21-34-45/0/> |
| Created by | Gareth Rees |
| Created on | 2014-02-24 21:31:20 |
| Last modified by | Gareth Rees |
| Last modified on | 2014-03-30 14:26:03 |
| History | 2014-02-24 GDR Created. |
| Change | Effect | Date | User | Description |
|---|---|---|---|---|
| 185089 | closed | 2014-03-30 14:26:02 | Gareth Rees | Turn on -Wunreachable-code for GCC and Clang. Remove unreachable code: * No need to have different debug options or structured allocation classes for different platforms. * Don't use STATISTIC_BEGIN, use STATISTIC_STAT. * #ifdef away the unused code in zmess.c for testing ControlAlloc failure. * Remove unused code from the example Scheme interpreter. |
| 184482 | open | 2014-02-24 21:32:22 | Gareth Rees | Refactor the computation of the chunk size into its own function, thus avoiding an "unreachable code" error from Clang. |
| 184478 | open | 2014-02-24 18:07:14 | Gareth Rees | Avoid use of unreachable code in protCatchThread on OS X. |