It was not intended in #500 that this warning crashes form, which happened here when Save was called in a pre-processor loop. This is due to the leading & of the message which triggers the source file line information. Warning protects from the crash by temporarily setting the "iswarning" variable which causes MesPrint to then not terminate.
This can be easily cleaned up later if Warning is refactored to take a format string and variable arguments.
An alternative would be to move the static int iswarning; of message.c into one of the header files, but that seems equally as messy as this fix.
coverage: 50.008% (+0.04%) from 49.968%
when pulling ca8f53a53a0989200353d45d813b1371d1bedfd5 on jodavies:better-500
into 4fc8e4047a2678c3d0d264f29866491107f0a63c on vermaseren:master.
It was not intended in #500 that this warning crashes form, which happened here when Save was called in a pre-processor loop. This is due to the leading & of the message which triggers the source file line information. Warning protects from the crash by temporarily setting the "iswarning" variable which causes MesPrint to then not terminate.
This can be easily cleaned up later if Warning is refactored to take a format string and variable arguments.
An alternative would be to move the
static int iswarning;
ofmessage.c
into one of the header files, but that seems equally as messy as this fix.