Ravenbrook / Projects / Memory Pool System / Issues

Memory Pool System


MPS issue job001248

Title: (source clarity) Badly named CHECK macros in config.h, check.h are confusing
Status: closed
Priority: nice
Assigned user: Richard Kistruck
Product: mps
Organization: Ravenbrook
Description: CHECK, CHECK_NONE, CheckNONE macros in config.h & check.h are badly named and confusing. "CHECK" is too short and general a string. "CHECK_NONE" means that checks-that-assert compile away to nothing, and the name should say that. "CheckNONE" is the check-level that skips all checks-that-assert. The last two should not sound similar.
There are also checks-that-do-not-assert, but are simply convenient boolean expressions: CHECKT, CHECKLVALUE, CHECKTYPE, CHECKFIELDAPPROX, CHECKFIELD. Why are these named beginning with "CHECK"?
Analysis: RHSK 2005-10-11
Looked at config.h & check.h. These macros are confusing: see job001157 for an example of real confusion they have caused.

RHSK 2006-12-13
See job000534 and job001545 -- more examples of real confusion caused.

Tidy up all the important names, and add explanatory comments in check.h. Source-only change: no change to function yet. (See job001545).

I would like to change the name of test-only CHECKLVALUE, CHECKTYPE, CHECKT, etc, but it's too big for today.

And NOTREACHED should be AVER_NOTREACHED -- again, too big for today.
How found: inspection
Evidence: config.h#14 & check.h#10
Observed in: 1.105.0
Introduced in: 0.0.0
Test procedure: none
Created by: Richard Kistruck
Created on: 2005-10-11 11:14:30
Last modified by: Richard Kistruck
Last modified on: 2006-12-13 19:11:54
History: 2005-10-11 RHSK created; defect found during analysis of job001157.
2006-12-13 RHSK note confusion caused to job000534 and job001545

Fixes

Change Effect Date User Description
161210 closed 2006-12-13 14:45:49 Richard Kistruck MPS sort out baroque CHECK macros (mainly config.h and check.h)
See job001248. Should be source-only change. Details:

CheckNONE,SHALLOW,DEEP -->> CheckLevelMINIMAL,SHALLOW,DEEP
[PROD_]CHECK_DEFAULT -->> [PROD_]CHECKLEVEL_INITIAL
CHECK[_NONE] -->> AVER_AND_CHECK[_NONE]

And add some comments.

Generated at 2008-11-21 22:13:49 by $Id: //info.ravenbrook.com/infosys/cgi/issue.cgi#430 $

Copyright © Ravenbrook Limited. This document is provided "as is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this document. You may not duplicate or reproduce this document in any form without the express permission of the copyright holder.

Ravenbrook / Projects / Memory Pool System / Issues