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