Szelethus added a comment.

In D72705#2241542 <https://reviews.llvm.org/D72705#2241542>, @balazske wrote:

> The summary of this last discussion is that it is not acceptable to have only 
> the simple check for the explicit comparison with a fixed constant. At least 
> not for return types where the "implicit" check (a check that is always true 
> or false for the error return value) is possible, for example the `char*` 
> case.

Indeed, though I think it is okay to keep them in the checker while this is 
being developed, because it still tests the infrastructure well enough. We 
should just remember to fine tune the set of functions we're checking before 
moving out of alpha.

> For functions that return a sort of "handle" (mainly a pointer to a struct 
> that is not normally used with pointer arithmetic) the checker can still be 
> useful.

Agreed. This is true for //some// out-parameters as well.

> Another solution for the problem is if the system calls are modeled in a way 
> that there is always a state split between error end non-error (we will have 
> a path where it is known that the specific variable can be only (for example) 
> `NULL` and this can be detected by other checkers).

@NoQ had a great comment about the dangers of this: D79432#inline-757474 
<https://reviews.llvm.org/D79432#inline-757474>. If we still end up wanting to 
do this, then I agree with @martong, they should be placed in 
`StdLibraryFunctionsChecker`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72705/new/

https://reviews.llvm.org/D72705

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to