|Title||(source clarity) Badly named CHECK macros in config.h, check.h are confusing|
|Assigned user||Richard Kistruck|
|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"?
Looked at config.h & check.h. These macros are confusing: see job001157 for an example of real confusion they have caused.
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.
|Evidence||config.h#14 & check.h#10|
|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
|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.