[PATCH] D149158: [clang][analyzer] Cleanup tests of StdCLibraryFunctionsChecker (NFC)
Balázs Benics via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 26 05:32:10 PDT 2023
steakhal added inline comments.
================
Comment at: clang/test/Analysis/Inputs/std-c-library-functions.h:1-2
+typedef typeof(sizeof(int)) size_t;
+typedef signed long ssize_t;
+typedef struct {
----------------
`ssize_t`'s size should match the size of `size_t`. In this implementation, it would be true only if `size_t` is `long`.
================
Comment at: clang/test/Analysis/Inputs/std-c-library-functions.h:31
+int getchar(void);
+size_t fread(void *restrict, size_t, size_t, FILE *restrict);
+size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
----------------
`restrict` will only work if this header is included from `C` files. In `C++` files we will have a surprising behavior.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149158/new/
https://reviews.llvm.org/D149158
More information about the cfe-commits
mailing list