[Cryptography] cryptography Digest, Vol 47, Issue 1

Ray Dillinger bear at sonic.net
Wed Mar 1 16:39:49 EST 2017



On 03/01/2017 09:55 AM, Nemo wrote:

>     Rule 4 (recursion) 
> 
>     There shall be no direct or indirect use of recursive function
>     calls. [MISRA-C:2004 Rule 16.2; Power of Ten Rule 1]
> 
>     The presence of statically verifiable loop bounds and the absence of
>     recursion prevent runaway code, and help to secure predictable
>     performance for all tasks.  

Hm.  This even forbids recursion that has a statically provable bound.
For example, I often use constructions like:

int chomp(int *bigset, int *smallset, int bigsize, int smallsize){
   if (bigsize < smallsize)
       return(chomp(smallset, bigset, smallsize, bigsize));
   ....

Technically recursive, but the recursion provably bottoms after zero or
one stack frames and before anything else is called.  In fact it's even
a tail recursion that will on most compilers not use an extra stack
frame at all.

Still, forbidding recursion entirely is probably easier than allowing
cases that are provably subject to statically known space&time bounds,
and attempting to forbid anything whose definition is even a little bit
subtle is so subject to misunderstanding.

Eh, it's probably a good thing.  If I need to meet this standard, I'll
adapt.

			Bear
---
"Recursion:  P 342.  See also: Recursion." -- Index of Algol textbook.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://www.metzdowd.com/pipermail/cryptography/attachments/20170301/26671fb4/attachment.sig>


More information about the cryptography mailing list