20-10-2016, 09:36 AM
Good spot! I've been using those slides (in one form or another) for a couple of years now, and no-one has spotted that before! I will update the slide, ahead of my next Conference!
The features of stdarg.h are prohibited by Rule 17.1 (Required) due to the range of Unspecified and Undefined behaviours associated with those features... most notably because the parameter types cannot be statically analysed. Good unit design should be able to remove the need for variable parameter lists.
If a variable number of parameters is really required, then a deviation (either with or without a Permit - see MISRA Compliance 2016) may be used - in this case, the deviation should detail all the necessary checks to ensure consistency between source and sink.
The features of stdarg.h are prohibited by Rule 17.1 (Required) due to the range of Unspecified and Undefined behaviours associated with those features... most notably because the parameter types cannot be statically analysed. Good unit design should be able to remove the need for variable parameter lists.
If a variable number of parameters is really required, then a deviation (either with or without a Permit - see MISRA Compliance 2016) may be used - in this case, the deviation should detail all the necessary checks to ensure consistency between source and sink.
<r>-----<br/>
Andrew Banks<br/>
Chairman, MISRA C WG<br/>
<B><s></s>Posting in a personal capacity<e></e></B></r>
Andrew Banks<br/>
Chairman, MISRA C WG<br/>
<B><s></s>Posting in a personal capacity<e></e></B></r>