bug-coreutils
[Top][All Lists]
Advanced

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

sc_tight_scope on cygwin


From: Eric Blake
Subject: sc_tight_scope on cygwin
Date: Thu, 26 Mar 2009 06:40:41 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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:

_main
_usage

along with several other false positives, for example:

_chopt_free
_chopt_init
_chown_files
_gid_to_name
_uid_to_name

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'").

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknLd8kACgkQ84KuGfSFAYCXoACdFMHZBqcommjESWgc6upUeck1
bH0An2jpEuLj2vz4yzkU2RzH0jIUtBvE
=a8J6
-----END PGP SIGNATURE-----
>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; } || :
-- 
1.6.1.2


reply via email to

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