Title | MPS does not compile with GCC 7.3 |
Status | closed |
Priority | essential |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | In the master sources at changelevel 195127: $ make -f xci6gc.gmk VARIETY=cool ... ss.c: In function 'StackScan': ss.c:49:9: error: variable 'warmest' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered] void *warmest; ^~~~~~~ |
Analysis | We don't actually call longjmp on this jump buffer, but there seems to be no way to tell that to GCC. The POSIX specification for longjmp [1] says "the values of objects of automatic storage duration are unspecified if they meet all the following conditions: They are local to the function containing the corresponding setjmp() invocation; They do not have volatile-qualified type; They are changed between the setjmp() invocation and longjmp() call." In this case "warmest" meets the three criteria. But we can make the variable volatile. |
How found | manual_test |
Evidence | [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/longjmp.html |
Created by | Gareth Rees |
Created on | 2018-09-23 20:23:42 |
Last modified by | Gareth Rees |
Last modified on | 2019-10-10 15:18:36 |
History | 2018-09-23 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
196419 | closed | 2019-10-10 15:18:03 | Gareth Rees | Avoid warning from gcc 5.4.0. |
195136 | closed | 2018-09-23 20:31:52 | Gareth Rees | Move assignment so as to avoid "variable 'warmest' might be clobbered by 'longjmp'". |