From 5b76fe392827a667e542368ab4a6a41770c8eeed Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Fri, 13 Mar 2015 18:05:51 -0400 Subject: [PATCH 1/5] doc/Makefile: enforce consistent suffixes Signed-off-by: Emilio G. Cota --- doc/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile.in b/doc/Makefile.in index dbd9daa..811cc7f 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -199,5 +199,5 @@ uninstall: done clean: - rm -f $(BUILD_DIR)/doc/*~ $(BUILD_DIR)/doc/*.3.gz $(BUILD_DIR)/doc/*.html + rm -f $(BUILD_DIR)/doc/*~ $(BUILD_DIR)/doc/*$(GZIP_SUFFIX) $(BUILD_DIR)/doc/*$(HTML_SUFFIX) From b4b916d7135b7dae7a80ea20ed4d890457308517 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Fri, 13 Mar 2015 18:06:57 -0400 Subject: [PATCH 2/5] doc/Makefile: add 'objcheck' target to check for missing OBJECTS ck/doc$ make objcheck 1>/dev/null ck_hs_put_unique is missing from OBJECTS ck_rhs_put_unique is missing from OBJECTS Signed-off-by: Emilio G. Cota --- doc/Makefile.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/Makefile.in b/doc/Makefile.in index 811cc7f..78cbe4e 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -189,6 +189,14 @@ html: $(BUILD_DIR)/doc/$$target$(HTML_SUFFIX); \ done +# check for entries that are missing in OBJECTS +objcheck: all + for file in `ls * | egrep '(ck|CK)_' | egrep -v "($(GZIP_SUFFIX)|$(HTML_SUFFIX))$$"`; do \ + if [ ! -f $${file}$(GZIP_SUFFIX) ]; then \ + echo "$$file is missing from OBJECTS" >&2; \ + fi; \ + done + install: mkdir -p $(DESTDIR)/$(MANDIR)/man3 || exit cp *$(GZIP_SUFFIX) $(DESTDIR)/$(MANDIR)/man3 || exit From 055ec1108053e5424c8f324e19be59616937769e Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Fri, 13 Mar 2015 18:13:23 -0400 Subject: [PATCH 3/5] doc/Makefile: add missing files to OBJECTS Signed-off-by: Emilio G. Cota --- doc/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/Makefile.in b/doc/Makefile.in index 78cbe4e..b79beb5 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -79,6 +79,7 @@ OBJECTS=CK_ARRAY_FOREACH \ ck_hs_next \ ck_hs_get \ ck_hs_put \ + ck_hs_put_unique \ ck_hs_set \ ck_hs_fas \ ck_hs_remove \ @@ -98,6 +99,7 @@ OBJECTS=CK_ARRAY_FOREACH \ ck_rhs_next \ ck_rhs_get \ ck_rhs_put \ + ck_rhs_put_unique \ ck_rhs_set \ ck_rhs_fas \ ck_rhs_remove \ From 1d3300ac3ab2e37b304efe8df61a834752fc1c9d Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Fri, 13 Mar 2015 18:16:18 -0400 Subject: [PATCH 4/5] doc/Makefile: add 'refcheck' to find missing cross-references Some missing references found are not surprising (e.g. *_INITIALIZER), but real mistakes are also found (ck_ht_init->ck_entry_set_direct). ck/doc$ make refcheck ck_brlock: ref to missing ck_bytelock(3) ck_ht_get_spmc: ref to missing ck_ht_entry_set_key(3) ck_ht_init: ref to missing ck_entry_set_direct(3) ck_ht_remove_spmc: ref to missing ck_ht_entry_set_key(3) ck_bitmap_test: ref to missing ck_bitmap_set_mpmc(3) ck_bitmap_test: ref to missing ck_bitmap_reset_mpmc(3) ck_bitmap_size: ref to missing ck_bitmap_set_mpmc(3) ck_bitmap_size: ref to missing ck_bitmap_reset_mpmc(3) ck_rwcohort: ref to missing CK_RWCOHORT_STRATEGY_PROTOTYPE(3) ck_rwcohort: ref to missing CK_COHORT_INITIALIZER(3) ck_rwcohort: ref to missing CK_COHORT_LOCKED(3) CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_TRYLOCK_PROTOTYPE(3) CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_INITIALIZER(3) CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_LOCK(3) CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_UNLOCK(3) CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_LOCKED(3) CK_RWCOHORT_INIT: ref to missing CK_RWCOHORT_TRYLOCK(3) CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_TRYLOCK_PROTOTYPE(3) CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_INITIALIZER(3) CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_LOCK(3) CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_UNLOCK(3) CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_LOCKED(3) CK_RWCOHORT_INSTANCE: ref to missing CK_RWCOHORT_TRYLOCK(3) CK_RWCOHORT_PROTOTYPE: ref to missing CK_RWCOHORT_INITIALIZER(3) CK_RWCOHORT_READ_LOCK: ref to missing CK_RWCOHORT_INITIALIZER(3) CK_RWCOHORT_READ_UNLOCK: ref to missing CK_RWCOHORT_INITIALIZER(3) CK_RWCOHORT_WRITE_LOCK: ref to missing CK_RWCOHORT_INITIALIZER(3) CK_RWCOHORT_WRITE_UNLOCK: ref to missing CK_RWCOHORT_INITIALIZER(3) ck_cohort: ref to missing CK_COHORT_LOCKED(3) ck_cohort: ref to missing CK_COHORT_INITIALIZER(3) ck_cohort: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_PROTOTYPE: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_PROTOTYPE: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_TRYLOCK_PROTOTYPE: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_TRYLOCK_PROTOTYPE: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_INSTANCE: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_INSTANCE: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_INIT: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_INIT: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_LOCK: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_LOCK: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_UNLOCK: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_UNLOCK: ref to missing CK_COHORT_LOCKED(3) CK_COHORT_TRYLOCK: ref to missing CK_COHORT_INITIALIZER(3) CK_COHORT_TRYLOCK: ref to missing CK_COHORT_LOCKED(3) ck_sequence: ref to missing ck_bytelock(3) Signed-off-by: Emilio G. Cota --- doc/Makefile.in | 4 ++++ doc/refcheck.pl | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 doc/refcheck.pl diff --git a/doc/Makefile.in b/doc/Makefile.in index b79beb5..1915f2a 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -199,6 +199,10 @@ objcheck: all fi; \ done +# check for stale references +refcheck: + @./refcheck.pl $(OBJECTS) + install: mkdir -p $(DESTDIR)/$(MANDIR)/man3 || exit cp *$(GZIP_SUFFIX) $(DESTDIR)/$(MANDIR)/man3 || exit diff --git a/doc/refcheck.pl b/doc/refcheck.pl new file mode 100755 index 0000000..1ed3a65 --- /dev/null +++ b/doc/refcheck.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +my @files = @ARGV; + +my $h; + +foreach my $file (@files) { + $h->{$file} = 1; +} + +foreach my $file (@files) { + open(my $fh, "<", $file) or die "cannot open < $file: $!"; + while (<$fh>) { + chomp; + if ($_ =~ /\.Xr ((ck|CK)_[a-zA-Z_]+) ([0-9])/) { + my $name = $1; + my $section = $3; + if (!$h->{$name}) { + print STDERR "$file: ref to missing ${name}($section)\n"; + } + } + } + close($fh) or die("cannot close $file: $!"); +} From ed3339eb203504fe9804ce7285a476e96153ab1f Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Fri, 13 Mar 2015 18:19:30 -0400 Subject: [PATCH 5/5] doc/ck_ht_init: fix reference to ck_ht_entry_set_direct Signed-off-by: Emilio G. Cota --- doc/ck_ht_init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ck_ht_init b/doc/ck_ht_init index 602483d..757a39a 100644 --- a/doc/ck_ht_init +++ b/doc/ck_ht_init @@ -76,7 +76,7 @@ with using the .Xr ck_ht_entry_key_direct 3 , .Xr ck_ht_entry_value_direct 3 and -.Xr ck_entry_set_direct 3 +.Xr ck_ht_entry_set_direct 3 functions. Attempting a hash table operation with a key of value of 0 or UINTPTR_MAX will result in undefined behavior. .El