Honor library ignorefunction() settings when reporting unused functions.#8130
Honor library ignorefunction() settings when reporting unused functions.#8130rgetz wants to merge 1 commit intodanmar:mainfrom
Conversation
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 <rgetz503@gmail.com>
b08bd93 to
cd49158
Compare
|
|
Currently, the attribute is used in |
|
Thanks for pointing this out. You’re right that which implies this attribute is intended to be a general library configuration signal rather than something check-specific or accidental. (happy to be corrected in my understanding if I'm wrong). Given that:
…using it to suppress unused-function diagnostics seems consistent with the schema-level intent: “this function should be ignored by certain analyses.” Today, unused-function reporting ignores that signal, which leads to false positives even when the user has explicitly annotated the function in the library config... That said, I agree on two points:
If folks prefer to keep Just let me know. |
|
@danmar Do you know anything about the |
|
I don't remember specifics about I don't know if that is OK for you but can't some "maybe_unused" attribute be used on functions? |
|
yeah, on further reflection, I don't want the function to be ignored (all tests should run), I just didn't want it to show up in the I think what would be more natural is something that maybe reuses where the suppress is similar to the inline comment Let me know the preferred direction, and I will see what I can do... |
|
I think such |
|
Ok - thanks - will close this and replace with suggestions... |



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.
I have found this very useful when looking at libraries, and creating a
self.cfgfile which looks like: