Having multiple initializer functions in a constructor
Lint checks, if all of the members are initialized in the constructor. Optionally this check could be redirected to an initializer-function introduced with the -sem Command. But then the initialization has to be done completely in the initializer-function.
In our embedded software it is quite common to have more than one function doing the initialization task, e.g.:
member_a = 0;
member_b = 0;
member_c = 0;
It would be very helpful, that lint supports this way of doing initializations.
In the upcoming PC-lint Plus, full or partial initializations that takes place in functions called by a constructor are automatically recognized without the need for an initializer semantic. In the example provided, no message would be issued. The initializer semantic can still be used if the definition of an initializing member function is not available but otherwise isn’t necessary.
FYI, this issue is also described on the forum: http://www.gimpel.com/Discussion.cfm?ThreadID=3865&SessionID=4739975
It would be nice if lint could look at the sum total of initializations provided by the constructor and designated initialization functions.
We have exactly the same problem in our project: initializations are organized in several methods, since parts of the initializtions are also needed later after construction.
In the end we found no better solution than disabling the warning 1565 at all for the affected classes - too bad.