balazske wrote:

I do not see much benefit of adding `fileno` to the checker in the current 
state. If the `StdLibraryFunctionsChecker` is turned on it will anyway do a 
similar modeling of `fileno` (this applied to `ftell` too). The `fileno` and 
`ftell` are semantically different and `fileno` can be more complicated if we 
want to ensure that the returned file numbers are different from each other, 
and special values for `stdin`, `stdout`, `stderr` should be taken into account.
Adding `fileno` in the current way makes a small improvement for the case when 
`StdLibraryFunctionsChecker` is not used. A combined function for `fileno` and 
`ftell` can be used, but in a way that works with any function that returns -1 
on error and >=0 value on success. The type of the return value can be get from 
the declaration of the function or from the `CallEvent` in some way, a type 
parameter to the function is not needed.
Adding the standard streams to the checker has some difficulties and requires 
more work (at least there must be a checker parameter to assume that standard 
streams are not changed by the program, otherwise no modeling can be done 
because these are global variables).

https://github.com/llvm/llvm-project/pull/76207
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to