Feature #1997

Improve error check at compilation time

Added by pespin about 1 year ago. Updated about 1 year ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


I recently fixed a crash which was originated by a function expected to return a pointer and actually missing an explicit return in a specific code path instead of returning NULL.

IMHO this should enable compilation flags to at least have warning about this kind of error to avoid running into similar issues in the future (and we may actually find there are still similar issues nowadays).

It should at least print a warning message at compile time (-Wreturn-type ?), but I think the best would be to treat those cases as errors by default (-Werror), so that we keep the code clean and we then care about the issues printed by the compiler. Other kind of similar checks would be also welcome.

As far as I know, there's some part at least in osmo-iuh which is auto-generated and may print lots of warnings which we cannot fix. I guess in this case we can apply different CFLAGS to that specific set of files which is more relaxed to avoid lots of garbage warnings.


#1 Updated by pespin about 1 year ago

It seems some related work was already done in openbsc. Worth having a look and applying something similar:

Also available in: Atom PDF