This is an archive of the discontinued LLVM Phabricator instance.

[clang][analyzer] Add some functions to StreamChecker with errno modeling.
AbandonedPublic

Authored by balazske on Aug 19 2022, 9:10 AM.

Details

Summary

Functions fsetpos, fgetpos, ftell, rewind are added.
Function fileno is handled by StdLibraryFunctionsChecker too,
tests are added for it but eval function is not needed.

Diff Detail

Event Timeline

balazske created this revision.Aug 19 2022, 9:10 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 19 2022, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2022, 9:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
martong added inline comments.Sep 28 2022, 12:45 AM
clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.h
110

Why do you consider important the Std part in the naming?

clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
880

Could you please elaborate in the comment why don't we have to use errno_modeling::setErrnoForStdSuccess here?

clang/test/Analysis/stream-error.c
246

This might be TRUE as well isn't it? Because only the "successful call to the fseek() function clears the end-of-file indicator". I'd expect this to be TRUE only in the block of if (rc).

balazske abandoned this revision.Dec 20 2022, 1:35 AM

See D135247 and related for a new solution.