MPS issue job003677

TitleKeyword arguments not robust against user error
Statusclosed
Priorityessential
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIn 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
AnalysisThis 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 foundmanual_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 byGareth Rees
Created on2014-02-20 15:37:45
Last modified byGareth Rees
Last modified on2014-02-26 13:47:57
History2014-02-20 GDR Created.

Fixes

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.