Title | ANSI plinth does not check its arguments |
Status | closed |
Priority | optional |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | In 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.) |
Analysis | It'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 found | inspection |
Evidence | [1] //info.ravenbrook.com/project/mps/master/code/mpsioan.c |
Observed in | 1.111.0 |
Created by | Gareth Rees |
Created on | 2013-05-30 15:10:52 |
Last modified by | Gareth Rees |
Last modified on | 2013-09-11 14:15:48 |
History | 2013-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. |