bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sc_error_message_uppercase


From: Eric Blake
Subject: Re: sc_error_message_uppercase
Date: Thu, 27 Jan 2011 08:30:44 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 01/27/2011 08:16 AM, Jim Meyering wrote:
>>>>    @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
>>
>> Is there a way to tighten it, by passing the grep output through a sed
>> script that combines multiple lines (easily determined by the difference
>> between file: and file- for matching vs. context lines and the --
>> separator between hunks), then limit the detection of the capital letter
>> to one occurring after error( but before ';'?
> 
> That sounds like it'd be an improvement.  With that, we could
> search a couple more lines of following context, too.
> While I haven't been willing to spend any more time on it,
> you're welcome to do so.
> 
> One tiny fly in the ointment: ';' inside a string or in a comment
> between concatenated strings would cause trouble.

Yes, it means possible false negatives, but that's probably not a
practical concern.  Really, who writes code this awful, with a ; in a
comment prior to the error message?

error (0, errno, /* ; */ _("Oops"));

Whereas a ';' inside a string is not too likely to cause issues; this
(mis-)usage would still be caught:

error (0, errno, "%s", _("Oops; you did something wrong"));

because we are looking for any instance of "[A-Z] after the open ( but
before the first ;, and a ; within the string is after the point we care
about.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]