RE: [PATCH 00/12] Clang -Wformat warning fixes

From: Jan Engelhardt
Date: Fri Jun 10 2022 - 04:34:59 EST



On Friday 2022-06-10 10:17, David Laight wrote:
>>
>> Calling a "printf" style function is already insanely expensive. :-) I
>> understand that it's not okay blithely to increase runtime resources
>> simply because it's already slow, but in this case it's worthwhile.
>
>Yep, IMHO definitely should be fixed.
>It is even possible that using "%s" is faster because the printf
>code doesn't have to scan the string for format effectors.

I see no special handling; the vsnprintf function just loops
over fmt as usual and I see no special casing of fmt by
e.g. strcmp(fmt, "%s") == 0 to take a shortcut.