Title | Keyword arguments not robust against user error |
Status | closed |
Priority | essential |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | In change 182277 [1] I updated a call to mps_fmt_create_A to use the keyword argument interface (mps_fmt_create_k) but I forgot to call MPS_ARGS_DONE. This went unnoticed for several months until today when I got this assertion failure: arg.c:122: MPS ASSERTION FAILED: SigCheck Key: arg->key |
Analysis | This assertion should go off reliably if you forget the MPS_ARGS_DONE. Also, there should be an entry for this assertion in the "Common assertions and their causes" section of the manual [2]. Alternatively, we could avoid the need for MPS_ARGS_DONE altogether by changing MPS_ARGS_BEGIN and MPS_ARGS_ADD_FIELD to do: _var[_var##_i].key = MPS_KEY_ARGS_END; |
How found | manual_test |
Evidence | [1] <https://info.ravenbrook.com/infosys/cgi/perfbrowse.cgi?@describe+182277 >[2] < https://info.ravenbrook.com/project/mp...html#common-assertions-and-their-causes > |
Created by | Gareth Rees |
Created on | 2014-02-20 15:37:45 |
Last modified by | Gareth Rees |
Last modified on | 2014-02-26 13:47:57 |
History | 2014-02-20 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
184554 | closed | 2014-02-26 13:47:56 | Gareth Rees | Merge branch/2014-02-26/args-done into master sources. |