[analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax
authorGabor Marton <gabor.marton@ericsson.com>
Thu, 13 Feb 2020 11:11:24 +0000 (12:11 +0100)
committerGabor Marton <gabor.marton@ericsson.com>
Thu, 13 Feb 2020 12:51:51 +0000 (13:51 +0100)
commit536456a7e93d73b9ff4e92f3e51d1aa1c72628fe
tree139128c9599d9d36d8597c1c4c4e1acd11876b8c
parent26f6aa9e3ba47c5ccb9d837310b59a5087549b7d
[analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

Summary:
Both EOF and the max value of unsigned char is platform dependent. In this
patch we try our best to deduce the value of EOF from the Preprocessor,
if we can't we fall back to -1.

Reviewers: Szelethus, NoQ

Subscribers: whisperity, xazax.hun, kristof.beyls, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalh

Tags: #clang

Differential Revision: https://reviews.llvm.org/D74473
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp
clang/test/Analysis/std-c-library-functions-eof.c [new file with mode: 0644]