This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Avoid "format not a string literal" warnings
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 13 Apr 2016 17:03:03 -0400
- Subject: Re: [PATCH] Avoid "format not a string literal" warnings
- Authentication-results: sourceware.org; auth=none
- References: <1460574365-21910-1-git-send-email-palves at redhat dot com> <8737qpp8sg dot fsf at redhat dot com> <570EAB47 dot 8040102 at redhat dot com>
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/