[clang] [analyzer] Fix FN for UCRT fopen ignoring the lack of `restrict` qualifier (PR #236747)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 3 01:54:00 PST 2026
NagyDonat wrote:
> Why did we have that in the first place, we must have had some solid arguments for doing all of this work.
The default equality comparison of `QualType`s distinguishes `restrict` and non-`restrict` types (which is natural, they are not completely identical), and by default `StdLibraryFunctionsChecker` used this comparison. Originally the function descriptions did not contain any restrict qualifiers, which caused bugs when they did not match declarations with `restrict`.
To fix this https://github.com/llvm/llvm-project/commit/8f961399739f539cb0b3c9ac68ca1b62c2a17a80 added `restrict` to the signature of functions that (usually) have it. (Alternative approaches, like ignoring `restrict` were not mentioned in the review of that commit.)
https://github.com/llvm/llvm-project/pull/236747
More information about the cfe-commits
mailing list