stylist
stylist copied to clipboard
Missing pointer initialisation rule is not useful
It is well known that using the initialiser syntax on local variables makes them "saved" and therefore global scope, i.e. persistent between calls. This is very rarely useful behaviour in modern code.
It was thought that pointers were an exception to this rule but it has become clear they are not. As such the missing pointer initialisation rule is not useful.
It should be replaced by two new rules. One which ensures there are no declaration initialisations. This will prevent any of those implicit globals.
The second is a check that the first thing in the code of any procedure is nullification of any local pointers. This may be spread across one or more nullify statements.