[PATCH] Avoid "format not a string literal" warnings

Sergio Durigan Junior sergiodj@redhat.com
Wed Apr 13 21:03:00 GMT 2016


On Wednesday, April 13 2016, Pedro Alves wrote:

> On 04/13/2016 09:12 PM, Sergio Durigan Junior wrote:
>
>>>    if (alias_argv[0] == NULL || command_argv[0] == NULL
>>>        || *alias_argv[0] == '\0' || *command_argv[0] == '\0')
>>> -    error (_(usage));
>>> +    alias_usage_error ();
>> 
>> I'd call error directly here and above (and yes, replicate the message),
>> but that is a matter of personal taste.
>
> OOC, is there a reason for that preference?

Just avoiding a one-line-function call, and the fact that the message is
replicated just twice and will likely not change.

> Instead of replicating the message, I also thought of:
>
>     error (("%s"), usage);
>
> but it seems slightly nicer to me the way I wrote it ( obviously :-) ).

For sure.  I'd say go ahead with your way, no reason to bikeshed over
this :-).

Thanks for the patch.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/



More information about the Gdb-patches mailing list