Add printf format attribute and const qualifier to _s_out#3
Add printf format attribute and const qualifier to _s_out#3assisted-by-ai wants to merge 3 commits intoKicksecure:masterfrom
Conversation
Annotate _s_out() with __printf(2, 3) so the compiler warns on format string mismatches. Also mark fmt parameter as const since it is not modified. https://claude.ai/code/session_018RqemCaZDrhmA7jV2eBgQ3
|
I don't have a problem with the concept behind this code, but given the small size and limited scope of tirdad, I don't expect it to get big enough for this to be very useful. We'd probably want to upstream this if we were to integrate it, and given how small and arguably "pedantic" it is, I don't know if we should bother upstream with this. (I'm also not sure the syntax Claude is using is correct.) |
|
Thoughts on this one? @0xsirus |
|
The syntax is correct. That said, I agree the practical value is minimal here — there are only 5 call sites, all with string literals and no format arguments. Happy to close this if you'd prefer not to upstream it. |
|
The existing print function is fine and the suggested change is not necessary. |
The Kicksecure#3 maintainer feedback is that the __printf attribute change is too pedantic for a module this small. Record this so future agents don't re-propose it. https://claude.ai/code/session_018RqemCaZDrhmA7jV2eBgQ3
|
superseded by assisted-by-ai#4 |
Summary
Improved type safety and compiler checking for the
_s_outfunction by adding a printf format attribute and const qualifier to the format string parameter.Key Changes
__printf(2, 3)attribute to the_s_outfunction declaration and definition to enable compiler format string validationfmtparameter fromchar *toconst char *to properly indicate that the format string is not modifiedImplementation Details
These changes enable the compiler to:
This is a non-functional change that improves code quality and catches potential bugs at compile time.
https://claude.ai/code/session_018RqemCaZDrhmA7jV2eBgQ3