In perl.git, the branch maint-5.10 has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bcd41b7997abaa21e066e80f23cd72857f8f5f56?hp=dbadabac3485b259e6be66dfb16a9479eb1fabda>

- Log -----------------------------------------------------------------
commit bcd41b7997abaa21e066e80f23cd72857f8f5f56
Author: David Mitchell <[email protected]>
Date:   Fri Mar 20 14:56:56 2009 +0000

    missed Porting/checkARGS_ASSERT.pl from previous commit
-----------------------------------------------------------------------

Summary of changes:
 Porting/checkARGS_ASSERT.pl |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 Porting/checkARGS_ASSERT.pl

diff --git a/Porting/checkARGS_ASSERT.pl b/Porting/checkARGS_ASSERT.pl
new file mode 100644
index 0000000..3d8e2fc
--- /dev/null
+++ b/Porting/checkARGS_ASSERT.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/perl -w
+use strict;
+
+# Print out any PERL_ARGS_ASSERT* macro that was declared but not used.
+
+my %declared;
+my %used;
+
+open my $fh, '<', 'proto.h' or die "Can't open proto.h: $!";
+while (<$fh>) {
+    $declared{$1}++ if /^#define\s+(PERL_ARGS_ASSERT[A-Za-z_]+)\s+/;
+}
+
+if (!...@argv) {
+    open my $fh, '<', 'MANIFEST' or die "Can't open MANIFEST: $!";
+    while (<$fh>) {
+       # *.c or */*.c
+       push @ARGV, $1 if m!^((?:[^/]+/)?[^/]+\.c)\t!;
+    }
+}
+
+while (<>) {
+    $used{$1}++ if /^\s+(PERL_ARGS_ASSERT_[A-Za-z_]+);$/;
+}
+
+my %unused;
+
+foreach (keys %declared) {
+    $unused{$_}++ unless $used{$_};
+}
+
+print $_, "\n" foreach sort keys %unused;

--
Perl5 Master Repository

Reply via email to