From cff8144c88808500f424c5ca617302be28ae4f56 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 12 Feb 2023 19:19:28 -0600 Subject: [PATCH] Do not do format checking on static functions. It is legal for source files that do not include to define static functions named printf, scanf, etc. These obviously are not the standard library functions and are not required to work the some way as them, so they should not be subject to format checking. --- Expression.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Expression.pas b/Expression.pas index 35bb113..28a5eba 100644 --- a/Expression.pas +++ b/Expression.pas @@ -3397,8 +3397,11 @@ var fmt := fmt_none; fp := nil; - if ((lint & lintPrintf) <> 0) and fType^.varargs and not indirect then - fmt := FormatClassify(ftree^.id^.name^); + if (lint & lintPrintf) <> 0 then + if fType^.varargs then + if not indirect then + if ftree^.id^.storage <> private then + fmt := FormatClassify(ftree^.id^.name^); while parameters <> nil do begin {count the prototypes} pCount := pCount+1;