The regulation I was thinking of is MISRA[1], a very popular piece of convention that is used and referenced in, among other things, the JSF program (F-35 fighter airplane), the Jet Propulsion Laboratory (NASA), and AutoSar (another standard for embedded system in automotives).
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 <stdlib.h> 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:/...