[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 11:59:10 PDT 2023


================
@@ -1350,10 +1360,17 @@ void Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
             llvm::APSInt::getUnsigned(H.getSizeLowerBound())
                 .extOrTrunc(SizeTypeWidth);
         if (FormatSize > *SourceSize && *SourceSize != 0) {
-          DiagID = diag::warn_fortify_source_format_truncation;
-          DestinationSize = SourceSize;
-          SourceSize = FormatSize;
-          break;
----------------
zygoloid wrote:

This diagnostic used to override the production of the `warn_fortify_source_size_mismatch` warning, and now is produced in addition to it. Is that intentional?

https://github.com/llvm/llvm-project/pull/65969


More information about the cfe-commits mailing list