Changeset 202
- Timestamp:
- Mar 9, 2004, 5:59:06 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/utils/check-namespace (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/utils/check-namespace
r143 r202 3 3 # Check that a set of .h files and .o and .a files satisfy the Pan-STARRS 4 4 # rules about namespaces. 5 # 6 # This is a real hack; it should be rewritten to parse the .h files correctly. XXX 5 7 # 6 8 # Robert Lupton (rhl@astro.princeton.edu) February 2004 … … 34 36 Options: 35 37 -h, -? Print this message 38 -d Don't warn about symbols defined in .h files but not found by nm 36 39 -p prefix Change prefix from ps to \"prefix\" 37 40 -v Be chatty (repeat for even more output) … … 47 50 $pprefix = "p_$prefix"; 48 51 } 52 } elsif($ARGV[0] eq "-d") { 53 $allow_missing_definitions = 1; 49 54 } elsif($ARGV[0] eq "-v") { 50 55 $verbose++; … … 154 159 # and should obey the same rules 155 160 # 156 if (s/((typedef\s+)?enum) //) {161 if (s/((typedef\s+)?enum)(\s*{)/$3/) { 157 162 $typedef = $1; 158 163 $is_enum_typedef = ($typedef =~ /typedef/) ? 1 : 0; … … 260 265 } 261 266 262 if ($type eq "b") { $type = "d"; } # don't distinguish BSS and Data267 if ($type eq "b") { $type = "d"; } # don't distinguish BSS, Common, and Data 263 268 if ($type eq "B") { $type = "D"; } 269 if ($type eq "C") { $type = "D"; } 264 270 265 271 if ($type !~ /[DT]/i) { # Data or Text section … … 295 301 # Now check for unused declarations 296 302 # 297 foreach $name (sort keys %declarations) { 298 if (!$used_declarations{$name} && !$typedefs{$name} && !$defines{$name}) { 299 warn "$name was declared in $declarations{$name} but not defined\n"; 300 } 301 } 303 if (!$allow_missing_definitions) { 304 foreach $name (sort keys %declarations) { 305 if (!$used_declarations{$name} && !$typedefs{$name} && !$defines{$name}) { 306 warn "$name was declared in $declarations{$name} but not defined\n"; 307 } 308 } 309 }
Note:
See TracChangeset
for help on using the changeset viewer.
