Earlier quoted context omitted.
>it's not true that using an explicit stack takes "a lot more code" (it's like, three extra lines) I don't know if you mean that literally or just as a rhetorical exaggeration, but it's absolutely false. The first example that came to mind is Quick Sort, search for the iterative version of the algorithm and compare it with the traditional recursive version, easily a 10x factor. The increase in complexity isn't linear…
Do you have a source for the embedded systems safety regulations bit? I was under the impression that governments had neither insight nor competence to decide such matters.
From [2] (2012 version) (warning : annoying ads and misleading download button takes you to registration, but it's the only free source I could find with detailed rationale in each rule) :
Rule 15.5 : A function shall have a single point of exit at the end
Rule 21.3 : Memory allocation and deallocation functions of shall not be used.
From [3] (2004 version) (pdf) :
Rule 14.7 : [Same as Rule 15.5 of [2]]
Rule 20.4 : Dynamic heap allocations shall not be used
[3] is a pdf containing the 2004 version of the conventions, but no rationale is given for each rule.
>governments had neither insight nor competence to decide such matters.
On the contrary, things like banks, medical devices, aerospace and defense are heavily regulated by the government, source code is just another component in the whole system, why shouldn't it be regulated like hardware ?
As for competence, the government is not all bureaucrats and officials, they can hire specialists to do their inspections.
[1] https://en.m.wikipedia.org/wiki/MISRA_C
[2] https://www.academia.edu/40301277/MISRA_C_2_012_Guidelines_f...
[3]https://www.google.com/url?sa=t&source=web&rct=j&url=https:/...