bug-coreutils
[Top][All Lists]
Advanced

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

Re: sc_tight_scope on cygwin


From: Jim Meyering
Subject: Re: sc_tight_scope on cygwin
Date: Thu, 26 Mar 2009 14:32:05 +0100

Eric Blake wrote:
> My next 'make syntax-check' failure comes from sc_tight_scope.  On cygwin,
> all exported symbols include a leading underscore, so the check complains
> about a large number of these:

Thanks for testing!

> The attached patch relaxes that rule in src/Makefile.am to strip leading
> underscores from symbols, hopefully it doesn't introduce further problems
> (we don't actually declare anything with leading underscore, do we?).  OK
> to commit?  With this patch, 'make syntax-check' got further (it is now
> failing on sc_strftime_check, with "info: No menu item `date' in node
> `(libc.info.gz)Top'").

For me, that rule's "info libc date calendar format" command
prints the "21.4.5 Formatting Calendar Time" section.
Not for you, I suppose?

Here's my menu hierarchy down to that section:

  Main Menu
    Date and Time
      Calendar Time
        Formatting Calendar Time


> Unfortunately, I could not figure out an easy way to make the patch teach
> sc_tight_scope to mention which .o file contains the function that it is
> complaining about.
>
> --
> Don't work too hard, make some time for fun as well!
>
> Eric Blake             address@hidden
>>From 99f70d210951fe9bf3cf38d4e5b9a07a69058d03 Mon Sep 17 00:00:00 2001
> From: Eric Blake <address@hidden>
> Date: Thu, 26 Mar 2009 06:39:14 -0600
> Subject: [PATCH] tests: fix 'make sc_tight_scope' on cygwin
>
> * src/Makefile.am (sc_tight_scope): Ignore leading underscores in symbols.
> ---
>  src/Makefile.am |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 2313ed3..eec978f 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -447,7 +447,7 @@ sc_tight_scope: $(all_programs)
>         perl -ne '/^extern \S+ (\S*) \(/ and print "$$1\n"' $$hdr;    \
>       ) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t;                 \
>       nm -e *.$(OBJEXT)                                               \
> -         | sed -n 's/.* T //p'                                       \
> +         | sed -n 's/.* T _?//p'                                     \
>           | grep -Ev -f $$t &&                                        \
>         { echo 'the above functions should have static scope' 1>&2;   \
>           exit 1; } || : ;                                            \
> @@ -455,7 +455,7 @@ sc_tight_scope: $(all_programs)
>         perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"'       \
>           $$hdr *.h ) | $(ASSORT) -u > $$t;                           \
>       nm -e *.$(OBJEXT)                                               \
> -         | sed -n 's/.* [BD] //p'                                    \
> +         | sed -n 's/.* [BD] _?//p'                                  \
>           | grep -Ev -f $$t &&                                        \
>         { echo 'the above variables should have static scope' 1>&2;   \
>           exit 1; } || :

The above doesn't work at all for me.
Using ? in a sed regexp is not portable:

    $ echo _a |sed 's/_?/x/'
    _a
    $ echo _a |sed 's/_\?/x/'
    xa

This sort of change should have the same effect, but more portably:

        nm -e *.$(OBJEXT)                                               \
            | sed -n 's/.* T //p'                                       \
+           | sed 's/^_//'                                              \
            | grep -Ev -f $$t &&                                        \
          { echo 'the above functions should have static scope' 1>&2;   \
            exit 1; } || : ;                                            \




reply via email to

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