Open elfring opened 2 years ago
All these are very good catches. Thanks. Would you be willing to PR the changes?
:thought_balloon: Would you become interested to use a development tool like “clang-tidy” for corresponding source code adjustments?
How do you think about to adjust any more source code places? :thinking:
Yes, we use it. As shown in different places here https://mne-cpp.github.io/pages/development/contribute.html, we use qtcreator for development and that brings clang-tidy by default. But we have an unsurmountable amount of warnings. So I guess the ones you are mentioning are probably there... We keep addressing them frequently, although not frequently enough.
How do you think about to improve the software situation any more by influencing evolution according to development tools for automatic source code adjustments? :thinking:
That's a good idea. But I think that the chances of a fix generating more harm than good are, in my opinion too high. Our testing pipeline, or our coverage, aren't in great either. So it would mean that it would be hard to catch the generated problem. Bear in mind that some of our libraries inherit from c libraries which implement a particular way of managing memory. This means that these components live a long way from raii.
Search patterns can be specified for questionable source code places. They can become more sophisticated on demand, can't they? :thinking:
Extra null pointer checks are not needed in functions like the following.