bug-gnulib
[Top][All Lists]
Advanced

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

Re: tight-scope check confusion


From: Jim Meyering
Subject: Re: tight-scope check confusion
Date: Mon, 11 Nov 2013 06:30:49 -0800

On Thu, Nov 7, 2013 at 9:52 AM, Reuben Thomas <address@hidden> wrote:
> On 7 November 2013 14:55, Jim Meyering <address@hidden> wrote:
>>
>> Can you investigate, e.g., instrumenting those rules to see what's
>> happening (then I don't have to ask for instructions on how to
>> reproduce :-), for example, by, inserting "| tee /tmp/1" or similar in
>> piplelines to see what intermediate results look like?
>
>
> Thanks for the gentle hint. Initially, I get the following functions output:
...
> After some rummaging, I found the problem. The following pipeline:
>
>       grep -h -A1 '^extern .*[^;]$$' $$src                \
>         | grep -vE '^(extern |--)' | sed 's/ .*//'
>
> was coming up with an empty line, by making:
>
> extern _GL_ATTRIBUTE_CONST const char* defaultpapersizefile(void) {
>     return PAPERCONF;
>
> into an empty string. This was then later -v-matching every line of a list
> of functions, and hence no error was generated.
>
> I guessed at this point that I was supposed to do GNU-style declarations.
>
> Bingo!
>
> There's nothing in the documentation about this assumption, AFAICS.

Glad you found it.
If you can find a good way to document it, I'd appreciate a patch.
I took a quick look, and was not terribly satisfied.  The whole approach of
using grep+sed to parse C (for extern symbol names) is fraught with so much
risk of error... As you've found, the failure mode can be hard to diagnose, so
I'm sure there is plenty of room for improvement in the rule itself, too.



reply via email to

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