Update gellyfish's e-mail.
[p5sagit/p5-mst-13.2.git] / Porting / checkARGS_ASSERT.pl
CommitLineData
7918f24d 1#!/usr/bin/perl -w
2use strict;
3
4# Print out any PERL_ARGS_ASSERT* macro that was declared but not used.
5
6my %declared;
7my %used;
8
9open my $fh, '<', 'proto.h' or die "Can't open proto.h: $!";
10while (<$fh>) {
11 $declared{$1}++ if /^#define\s+(PERL_ARGS_ASSERT[A-Za-z_]+)\s+/;
12}
13
14if (!@ARGV) {
15 open my $fh, '<', 'MANIFEST' or die "Can't open MANIFEST: $!";
16 while (<$fh>) {
17 # *.c or */*.c
18 push @ARGV, $1 if m!^((?:[^/]+/)?[^/]+\.c)\t!;
19 }
20}
21
22while (<>) {
23 $used{$1}++ if /^\s+(PERL_ARGS_ASSERT_[A-Za-z_]+);$/;
24}
25
26my %unused;
27
28foreach (keys %declared) {
29 $unused{$_}++ unless $used{$_};
30}
31
32print $_, "\n" foreach sort keys %unused;