This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

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.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]