Page MenuHomePhabricator

[clang][analyzer] Errno modeling code refactor (NFC).

Authored by balazske on Aug 15 2022, 1:30 AM.



Some of the code used in StdLibraryFunctionsChecker is applicable to
other checkers, this is put into common functions. Errno related
parts of the checker are simplified and renamed. Documentations in
errno_modeling functions are updated.

This change makes it available to have more checkers that perform
modeling of some standard functions. These can set the errno state
with common functions and the bug report messages (note tags) can
look similar.

Diff Detail

Event Timeline

balazske created this revision.Aug 15 2022, 1:30 AM
Herald added a reviewer: NoQ. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
balazske requested review of this revision.Aug 15 2022, 1:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2022, 1:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
steakhal accepted this revision.Aug 15 2022, 3:51 AM

Approved with nits. Thanks!


The same applies for these.


I would prefer returning nullptr explicitly here.


I believe you should use Twine() for chaining string slices.


It seems like you are already within this namespace. You don't need to explicitly qualify this.


Why don't you = default it if the body is actually empty?


I find this name much more appealing than it was before! Thanks.

This revision is now accepted and ready to land.Aug 15 2022, 3:51 AM
balazske updated this revision to Diff 453231.Aug 17 2022, 1:34 AM
balazske marked 4 inline comments as done.

Small improvements.

balazske marked an inline comment as done.Aug 17 2022, 8:20 AM
martong accepted this revision.Aug 31 2022, 8:30 AM


This revision was automatically updated to reflect the committed changes.