bug-gnulib
[Top][All Lists]
Advanced

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

sc_prohibit_*_without_use


From: Bruno Haible
Subject: sc_prohibit_*_without_use
Date: Tue, 17 Jan 2012 19:53:15 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Hi Jim,

Would it be possible to generalize the sc_prohibit_*_without_use rules
to more header files easily?

# Don't include this header unless you use one of its functions.
sc_prohibit_error_without_use:
        @h='error.h' \
        re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? 
*\('\
          $(_sc_header_without_use)

How about generating the list of identifiers that are declared in a header
file (macros, variables, functions, type, struct names, union names,
enum names, enum tags) and compute a regular expression that matches them?

For the first part, one could use 'ctags'? Or, if only 'extern' declared
entities matter, one can use this script that I use in libunistring:
http://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=lib/declared.sh

Also, it would be useful to extend this to POSIX header files, such
as <stdlib.h> or <unistd.h>, by making use of the info found in
glibc/conform/data/*.h-data.

Bruno




reply via email to

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