From cd491580654bb63c1924b9721fccb46b0063feac Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 16 Jan 2026 14:57:59 -0500 Subject: [PATCH] Honor library ignorefunction() settings when reporting unused functions. This change updates CheckUnusedFunctions to skip functions explicitly marked as ignored by the library configuration, both during per-file checks and whole-program analysis. This prevents false positives for known framework hooks, callbacks, or externally-used symbols that should be intentionally excluded from unused-function diagnostics. Signed-off-by: Robin Getz --- lib/checkunusedfunctions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index 7edaff6c241..8f9e0b50aed 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -378,6 +378,8 @@ bool CheckUnusedFunctions::check(const Settings& settings, ErrorLogger& errorLog continue; if (settings.library.isentrypoint(it->first)) continue; + if (settings.library.ignorefunction(it->first)) + continue; if (!func.usedSameFile) { if (isOperatorFunction(it->first)) continue; @@ -490,6 +492,9 @@ void CheckUnusedFunctions::analyseWholeProgram(const Settings &settings, ErrorLo if (settings.library.isentrypoint(functionName)) continue; + if (settings.library.ignorefunction(functionName)) + continue; + if (calls.find(functionName) == calls.end() && !isOperatorFunction(functionName)) { const Location &loc = decl->second; unusedFunctionError(errorLogger, loc.fileName, /*fileIndex*/ 0, loc.lineNumber, loc.column, functionName);