balazske added a comment.

About the "ftell" problem: The POSIX rules are really an extension of the C 
standard rules. At `ftell` according to C standard `errno` should be set to a 
positive value if error occurs. The POSIX rules extend this: `errno` is not 
changed if no error occurs. This can be correct, then the CERT `ftell` 
non-compliant example is wrong (on success `errno` remains always 0). It can be 
fixed if line `errno=0` is removed from the start of the non-compliant code. It 
may be best to use the POSIX rules for the checker, because the C standard does 
not say much and may need to require setting of `errno` to 0 before a standard 
function call.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135360

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

Reply via email to