Add an analyser for GErrors
Add an analyser to the plugin which assumes the initial state of (error == NULL || *error == NULL)
for all GError
s.
The intention of this analyser would be to:
- Prevent unchecked dereferences of
GError
s (since they may always beNULL
). - Prevent overwriting of
GError
s (setting oneGError
on top of another).
This is fairly poorly-defined at the moment, and needs more thought.
Also, it would be nice to check that:
- If an error is set,
NULL
is returned from the function. - If
NULL
is returned from the function, an error is set. (At least in the case of functions without(allow-none)
return types.)
Also, warn about the following construct:
GError *my_error; /* not initialised to NULL */
(Imported from bugs-everywhere; see #2 (closed).)