Anderson Lizardo wrote:
I suggest you use "grep ^HAVE_" instead of only "grep HAVE", so you
reduce the false positives. SANE for instance use macros like
"WE_HAVE_*" which I suppose are not to be listed.

So here goes a slightly modified snnipet, which does not create a temp file:

ifnames `find . -name \*.c -o -name \*.h` | grep ^HAVE_ | \
grep -v HAVE_CONFIG_H | cut -d" " -f1 | while read a; do \
grep -q $a config.h.in || echo "$a is missing"; done

Thanks for improvements.

If I understand correctly the issue, if e.g. the macro HAVE_XXX is not
defined on config.h, then the code sorrounded by "#ifdef HAVE_XXX ...
#endif" will never get compiled (except if someone adds "-DHAVE_XXX" to
CPPFLAGS), right?

yes.

Might it be the case that some of this code is
actually old/deprecated and just needs to be removed? After all, it's
never compiled, who would need it...

The two cases (forgotten config.h.in entry and obsolete code) cannot be distinguished from each other automatically. One of them is a bug.

It might also be good to report the problems upstream where possible.

Sure.

--
Alexander E. Patrakov
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to