MPS issue job003504

TitleANSI plinth does not check its arguments
Assigned userGareth Rees
DescriptionIn mpsioan.c [1], there are comments like this:

    FILE *f = (FILE *)mps_io; /* Should check f == ioFile */

If we had actually used assertions instead of comments, then we might have easily caught job003503. (By checking f != NULL, though, not f == ioFile.)
AnalysisIt's not clear to me why there are comments here and no assertions. I guess this is for a combination of the following reasons:

1. The plinth is not supposed to use internal MPS features, so it can't use AVER.
2. But if it uses assert() instead then these are outside the control of the MPS variety mechanism so they may end up being turned on in HOT variety or turned off in COOL variety (depending on whether or not the client program compiles the MPS with NDEBUG defined).
How foundinspection
Evidence[1] //
Observed in1.111.0
Created byGareth Rees
Created on2013-05-30 15:10:52
Last modified byGareth Rees
Last modified on2013-09-11 14:15:48
History2013-05-30 GDR Created.


Change Effect Date User Description
182327 closed 2013-05-30 16:21:42 Gareth Rees ANSI I/O module checks its arguments using AVER.