Project

General

Profile

Actions

Feature #1997

open

Improve error check at compilation time

Added by pespin about 7 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/10/2017
Due date:
% Done:

0%

Spec Reference:

Description

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.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)