diff options
author | Ben Pfaff <blp@nicira.com> | 2012-11-07 10:16:27 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-01-16 16:04:11 -0800 |
commit | 4958e3ee121f31909696e0d98930805f45ba9188 (patch) | |
tree | 60ba53dc4a8ae985d81a092d71b39b0518d17bb5 /Makefile.am | |
parent | 3e6c955de6fc7c50ea30ee9ea2148c6734e5df11 (diff) |
Makefile.am: add check that <assert.h> is not used from unexpected files.
In general, with a few specific exceptions, ovs_assert is now preferred
over assert, so this commit adds a check for that in the top-level
Makefile.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 878a1a96..328b248e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,6 +195,19 @@ rate-limit-check: fi .PHONY: rate-limit-check +# Check that assert.h is not used outside a whitelist of files. +ALL_LOCAL += check-assert-h-usage +check-assert-h-usage: + @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \ + (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \ + $(EGREP) -v '^lib/(sflow_receiver|vlog|worker).c$$|^tests/'; \ + then \ + echo "Files listed above unexpectedly #include <""assert.h"">."; \ + echo "Please use ovs_assert (from util.h) instead of assert."; \ + exit 1; \ + fi +.PHONY: check-assert-h-usage + if HAVE_GROFF ALL_LOCAL += manpage-check manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS) |