|Title||MPS does not compile with GCC 7.3|
|Assigned user||Gareth Rees|
|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]
|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  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 swap the assignment to warmest so that it comes before the call to STACK_CONTEXT_SAVE, and then it won't be clobbered by longjmp.
|Created by||Gareth Rees|
|Created on||2018-09-23 20:23:42|
|Last modified by||Gareth Rees|
|Last modified on||2018-10-22 13:51:50|
|History||2018-09-23 GDR Created.|
|195136||closed||2018-09-23 20:31:52||Gareth Rees||Move assignment so as to avoid "variable 'warmest' might be clobbered by 'longjmp'".|