Index: /trunk/archive/utils/check-namespace
===================================================================
--- /trunk/archive/utils/check-namespace	(revision 201)
+++ /trunk/archive/utils/check-namespace	(revision 202)
@@ -3,4 +3,6 @@
 # Check that a set of .h files and .o and .a files satisfy the Pan-STARRS
 # rules about namespaces.
+#
+# This is a real hack; it should be rewritten to parse the .h files correctly. XXX
 #
 # Robert Lupton (rhl@astro.princeton.edu)  February 2004
@@ -34,4 +36,5 @@
 Options:
 	-h, -?		Print this message
+	-d		Don't warn about symbols defined in .h files but not found by nm
 	-p prefix	Change prefix from ps to \"prefix\"
 	-v		Be chatty (repeat for even more output)
@@ -47,4 +50,6 @@
 	 $pprefix = "p_$prefix";
       }
+   } elsif($ARGV[0] eq "-d") {
+      $allow_missing_definitions = 1;      
    } elsif($ARGV[0] eq "-v") {
       $verbose++;
@@ -154,5 +159,5 @@
       # and should obey the same rules
       #
-      if (s/((typedef\s+)?enum)//) {
+      if (s/((typedef\s+)?enum)(\s*{)/$3/) {
 	 $typedef = $1;
 	 $is_enum_typedef = ($typedef =~ /typedef/) ? 1 : 0;
@@ -260,6 +265,7 @@
       }
 
-      if ($type eq "b") { $type = "d"; } # don't distinguish BSS and Data
+      if ($type eq "b") { $type = "d"; } # don't distinguish BSS, Common, and Data
       if ($type eq "B") { $type = "D"; }
+      if ($type eq "C") { $type = "D"; }
 
       if ($type !~ /[DT]/i) {	# Data or Text section
@@ -295,7 +301,9 @@
 # Now check for unused declarations
 #
-foreach $name (sort keys %declarations) {
-   if (!$used_declarations{$name} && !$typedefs{$name} && !$defines{$name}) {
-      warn "$name was declared in $declarations{$name} but not defined\n";
-   }
-}
+if (!$allow_missing_definitions) {
+   foreach $name (sort keys %declarations) {
+      if (!$used_declarations{$name} && !$typedefs{$name} && !$defines{$name}) {
+	 warn "$name was declared in $declarations{$name} but not defined\n";
+      }
+   }
+}
