Do not do format checking on static functions.

It is legal for source files that do not include <stdio.h> 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.
This commit is contained in:
Stephen Heumann 2023-02-12 19:19:28 -06:00
parent a6ef872513
commit cff8144c88
1 changed files with 5 additions and 2 deletions

View File

@ -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;