perl checking
These two small patches allow us to run "perl -cw" cleanly on all our
perl code.
One patch silences a warning from convutils.pl about the unportability
of the literal 0x100000000. We've run for many years without this giving
us a problem, so I think we can turn the warning off pretty safely.
The other patch provides a dummy library that emulates just enough of
the Win32 perl infrastructure to allow us to run these checks. That
means that Unix-based developers who might want to make changes in the
msvc code can actually run a check against their code without having to
put it on a Windows machine. The invocation goes like this (to check
Mkvcbuild.pl for example):
PERL5LIB=src/tools/msvc/dummylib perl -cw src/tools/Mkvcbuild.pm
This also allows us to check src/tools/win32tzlist.pl.
In due course I'll submit a script to automate this syntax checking.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:
perl-warnings-fix-msvc.patchtext/x-patch; name=perl-warnings-fix-msvc.patchDownload
diff --git a/src/tools/msvc/dummylib/README b/src/tools/msvc/dummylib/README
new file mode 100644
index 0000000..6e9617d
--- /dev/null
+++ b/src/tools/msvc/dummylib/README
@@ -0,0 +1,13 @@
+
+src/tools/msvc/dummylib
+
+This directory contains just enough of a dummy library to allow checking of
+the programs in src/tools/msvs and src/tools/win32tzlist.pl with
+perl -cw, even on machines that lack the Win32 perl infrastructure.
+
+invoke via:
+
+PERL5LIB=src/tools/msvc/dummylib perl -cw $file
+
+This is the only use that should be made of this directory. Attempting actually
+running of any programs using this library will result in a lot of grief.
diff --git a/src/tools/msvc/dummylib/Win32.pm b/src/tools/msvc/dummylib/Win32.pm
new file mode 100644
index 0000000..7849937
--- /dev/null
+++ b/src/tools/msvc/dummylib/Win32.pm
@@ -0,0 +1,2 @@
+package Win32;
+1;
diff --git a/src/tools/msvc/dummylib/Win32/Registry.pm b/src/tools/msvc/dummylib/Win32/Registry.pm
new file mode 100644
index 0000000..13895c9
--- /dev/null
+++ b/src/tools/msvc/dummylib/Win32/Registry.pm
@@ -0,0 +1,10 @@
+package Win32::Registry;
+
+use vars qw($HKEY_LOCAL_MACHINE);
+
+use Exporter ();
+our (@EXPORT,@ISA);
+@ISA = qw(Exporter);
+@EXPORT = qw($HKEY_LOCAL_MACHINE);
+
+1;
diff --git a/src/tools/msvc/dummylib/Win32API/File.pm b/src/tools/msvc/dummylib/Win32API/File.pm
new file mode 100644
index 0000000..d2f1453
--- /dev/null
+++ b/src/tools/msvc/dummylib/Win32API/File.pm
@@ -0,0 +1,11 @@
+package Win32API::File;
+
+use constant { SEM_FAILCRITICALERRORS => 1, SEM_NOGPFAULTERRORBOX => 2 };
+sub SetErrormode {};
+use Exporter;
+our(@ISA,@EXPORT_OK,%EXPORT_TAGS);
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(SetErrorMode SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX);
+%EXPORT_TAGS = (SEM_ => [qw(SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX)]);
+
+1;
perl-warnings-fix-convutils.patchtext/x-patch; name=perl-warnings-fix-convutils.patchDownload
diff --git a/src/backend/utils/mb/Unicode/convutils.pm b/src/backend/utils/mb/Unicode/convutils.pm
index 69ec099..e57342c 100644
--- a/src/backend/utils/mb/Unicode/convutils.pm
+++ b/src/backend/utils/mb/Unicode/convutils.pm
@@ -254,6 +254,9 @@ sub print_radix_table
my %b4map;
foreach my $in (keys %$c)
{
+ # silence perl diagnostic about portability of 0x100000000
+ no warnings qw(portable);
+
my $out = $c->{$in};
if ($in < 0x100)
On 5/18/18 14:02, Andrew Dunstan wrote:
These two small patches allow us to run "perl -cw" cleanly on all our
perl code.
It's not clear to me what that really means. My understanding is that
perl "warnings" are primarily a run-time instrument, unlike 'use strict'
and perl -c. I have been playing with a private branch that adds 'use
warnings' next to 'use strict' across the perl scripts, and there are a
number of warnings that pop up at run time. The fact that you get even
more warnings at compile time makes me wonder.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On 05/18/2018 09:05 PM, Peter Eisentraut wrote:
On 5/18/18 14:02, Andrew Dunstan wrote:
These two small patches allow us to run "perl -cw" cleanly on all our
perl code.It's not clear to me what that really means. My understanding is that
perl "warnings" are primarily a run-time instrument, unlike 'use strict'
and perl -c. I have been playing with a private branch that adds 'use
warnings' next to 'use strict' across the perl scripts, and there are a
number of warnings that pop up at run time. The fact that you get even
more warnings at compile time makes me wonder.
Mike Blackwell is working on some things that will help us lower the
severity of our perlcritic checks. One of those things will almost
certainly be to add "use warnings;" in quite a few places, so let's make
sure we don't duplicate effort.
Essentially "perl -cw" will make dure it can comoile the file and then
print warnings about those things it can detect at compile time. I have
found it a useful tool.
More importantly, there are several files in our Windows suite that a
Unix-based developer can't check even for compilation success, let alone
warnings, because they refer to libraries that only exist on Windows.
That's what the tiny dummy library is designed to fix.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
At Fri, 18 May 2018 14:02:39 -0400, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote in <5a6d6de8-cff8-1ffb-946c-ccf381800ea1@2ndQuadrant.com>
These two small patches allow us to run "perl -cw" cleanly on all our
perl code.One patch silences a warning from convutils.pl about the unportability
of the literal 0x100000000. We've run for many years without this
giving us a problem, so I think we can turn the warning off pretty
safely.
It was introduced by aeed17d000 (in 2017). The history of the
file is rather short. Over 32-bit values do not apperar as a
character so there's no problem in ignoring the warning for now,
but can't we use bigint to silence it instead?
The other patch provides a dummy library that emulates just enough of
the Win32 perl infrastructure to allow us to run these checks. That
means that Unix-based developers who might want to make changes in the
msvc code can actually run a check against their code without having
to put it on a Windows machine. The invocation goes like this (to
check Mkvcbuild.pl for example):PERL5LIB=src/tools/msvc/dummylib perl -cw src/tools/Mkvcbuild.pm
This also allows us to check src/tools/win32tzlist.pl.
In due course I'll submit a script to automate this syntax checking.
cheers
andrew
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
On 05/22/2018 04:11 AM, Kyotaro HORIGUCHI wrote:
At Fri, 18 May 2018 14:02:39 -0400, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote in <5a6d6de8-cff8-1ffb-946c-ccf381800ea1@2ndQuadrant.com>
These two small patches allow us to run "perl -cw" cleanly on all our
perl code.One patch silences a warning from convutils.pl about the unportability
of the literal 0x100000000. We've run for many years without this
giving us a problem, so I think we can turn the warning off pretty
safely.It was introduced by aeed17d000 (in 2017). The history of the
file is rather short. Over 32-bit values do not apperar as a
character so there's no problem in ignoring the warning for now,
but can't we use bigint to silence it instead?
It would impose an additional dependency. bigint isn't installed by
default on many systems AFAICT, so I think we'd need a better reason
than this to require it.
I was a little optimistic about claiming that 'perl -cw' would run
cleanly with these two patches - there's a little remediation that will
be required in the src/msvc/tools directory. These patches at least let
it run to completion.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
On 05/22/2018 04:11 AM, Kyotaro HORIGUCHI wrote:
At Fri, 18 May 2018 14:02:39 -0400, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote in <5a6d6de8-cff8-1ffb-946c-ccf381800ea1@2ndQuadrant.com>
One patch silences a warning from convutils.pl about the unportability
of the literal 0x100000000. We've run for many years without this
giving us a problem, so I think we can turn the warning off pretty
safely.
It was introduced by aeed17d000 (in 2017). The history of the
file is rather short. Over 32-bit values do not apperar as a
character so there's no problem in ignoring the warning for now,
but can't we use bigint to silence it instead?
It would impose an additional dependency. bigint isn't installed by
default on many systems AFAICT, so I think we'd need a better reason
than this to require it.
I agree with not adding a dependency (although FWIW, bigint does seem
to be there in my minimal perl setups). But can't we fix it like this:
- elsif ($in < 0x100000000)
+ elsif ($in <= 0xffffffff)
At least in a quick test here, "-cw" doesn't moan about 0xffffffff.
For consistency, the other arms of the "if" should be adjusted
similarly.
regards, tom lane
On 05/22/2018 10:09 AM, Tom Lane wrote:
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
On 05/22/2018 04:11 AM, Kyotaro HORIGUCHI wrote:
At Fri, 18 May 2018 14:02:39 -0400, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote in <5a6d6de8-cff8-1ffb-946c-ccf381800ea1@2ndQuadrant.com>
One patch silences a warning from convutils.pl about the unportability
of the literal 0x100000000. We've run for many years without this
giving us a problem, so I think we can turn the warning off pretty
safely.It was introduced by aeed17d000 (in 2017). The history of the
file is rather short. Over 32-bit values do not apperar as a
character so there's no problem in ignoring the warning for now,
but can't we use bigint to silence it instead?It would impose an additional dependency. bigint isn't installed by
default on many systems AFAICT, so I think we'd need a better reason
than this to require it.I agree with not adding a dependency (although FWIW, bigint does seem
to be there in my minimal perl setups). But can't we fix it like this:- elsif ($in < 0x100000000) + elsif ($in <= 0xffffffff)At least in a quick test here, "-cw" doesn't moan about 0xffffffff.
For consistency, the other arms of the "if" should be adjusted
similarly.
Yeah. I tested this on the oldest 32 but perls I could find, the msys
and activestate perls on the XP machine that runs frogmouth and friends.
Even though they both have an ivsize of 4, the arithmetic seems to work
properly. Perhaps they store larger numbers as doubles, which you should
be able to do exactly up to about 52 bit integers. The other 32 bit
machine I have is an Ubuntu 16.04 VM, but there the perl has an ivsize
of 8, so of course it does the right thing.
We don't normally use these scripts anyway, so I'll go with this
suggestion without further investigation.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
At Tue, 22 May 2018 15:02:46 -0400, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote in <a70c49ec-d816-9fd6-1565-38fb20cc7206@2ndQuadrant.com>
- elsif ($in < 0x100000000) + elsif ($in <= 0xffffffff)
This is one of my thougts and the reason for regarding it sour is
the following.
For consistency, the other arms of the "if" should be adjusted
similarly.
Yeah. I tested this on the oldest 32 but perls I could find, the msys
and activestate perls on the XP machine that runs frogmouth and
friends. Even though they both have an ivsize of 4, the arithmetic
seems to work properly. Perhaps they store larger numbers as doubles,
which you should be able to do exactly up to about 52 bit
integers. The other 32 bit machine I have is an Ubuntu 16.04 VM, but
there the perl has an ivsize of 8, so of course it does the right
thing.We don't normally use these scripts anyway, so I'll go with this
suggestion without further investigation.
Agreed. I'm fine with the direction.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
On 05/18/2018 02:02 PM, Andrew Dunstan wrote:
These two small patches allow us to run "perl -cw" cleanly on all our
perl code.One patch silences a warning from convutils.pl about the unportability
of the literal 0x100000000. We've run for many years without this
giving us a problem, so I think we can turn the warning off pretty
safely.The other patch provides a dummy library that emulates just enough of
the Win32 perl infrastructure to allow us to run these checks. That
means that Unix-based developers who might want to make changes in the
msvc code can actually run a check against their code without having
to put it on a Windows machine. The invocation goes like this (to
check Mkvcbuild.pl for example):PERL5LIB=src/tools/msvc/dummylib perl -cw src/tools/Mkvcbuild.pm
This also allows us to check src/tools/win32tzlist.pl.
In due course I'll submit a script to automate this syntax checking.
Here is the latest version of the second patch, this time with warnings
about redefinition of some subroutines suppressed. These mostly occur
because in a few cases we have multiple packages in a single file.
This allows the following command to pass cleanly:
{ find . -type f -a -name '*.p[lm]' -print; find . -type f -perm
-100 -exec file {} \; -print | egrep -i ':.*perl[0-9]*\>' |cut -d:
-f1 ; } | sort -u |
PERL5LIB=src/test/perl:src/test/ssl:src/bin/pg_rewind:src/backend/catalog:src/backend/utils/mb/Unicode:src/tools/msvc/dummylib:src/tools/msvc
xargs -L 1 perl -cw
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:
perl-warnings-fix-msvc-2.patchtext/x-patch; name=perl-warnings-fix-msvc-2.patchDownload
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index 27397ba..86979df 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -11,6 +11,8 @@ use strict;
use warnings;
use base qw(Project);
+no warnings qw(redefine);
+
sub _new
{
my $classname = shift;
@@ -399,6 +401,8 @@ use strict;
use warnings;
use base qw(MSBuildProject);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -420,6 +424,8 @@ use strict;
use warnings;
use base qw(MSBuildProject);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -464,6 +470,8 @@ use strict;
use warnings;
use base qw(VC2012Project);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -487,6 +495,8 @@ use strict;
use warnings;
use base qw(VC2012Project);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -510,6 +520,8 @@ use strict;
use warnings;
use base qw(VC2012Project);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index 261c913..0d35546 100644
--- a/src/tools/msvc/Project.pm
+++ b/src/tools/msvc/Project.pm
@@ -229,6 +229,7 @@ sub AddDir
if ($filter eq "LIBOBJS")
{
+ no warnings qw(once);
if (grep(/$p/, @main::pgportfiles, @main::pgcommonfiles)
== 1)
{
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 8f0b355..1440989 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -10,6 +10,8 @@ use strict;
use warnings;
use VSObjectFactory;
+no warnings qw(redefine);
+
sub _new
{
my $classname = shift;
@@ -768,6 +770,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -791,6 +795,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -815,6 +821,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -839,6 +847,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -863,6 +873,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -889,6 +901,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -915,6 +929,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProject.pm
index 03b890b..ad613b3 100644
--- a/src/tools/msvc/VCBuildProject.pm
+++ b/src/tools/msvc/VCBuildProject.pm
@@ -11,6 +11,8 @@ use strict;
use warnings;
use base qw(Project);
+no warnings qw(redefine);
+
sub _new
{
my $classname = shift;
@@ -268,6 +270,8 @@ use strict;
use warnings;
use base qw(VCBuildProject);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
@@ -289,6 +293,8 @@ use strict;
use warnings;
use base qw(VCBuildProject);
+no warnings qw(redefine);
+
sub new
{
my $classname = shift;
diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm
index eea59c5..8a5f8f9 100644
--- a/src/tools/msvc/VSObjectFactory.pm
+++ b/src/tools/msvc/VSObjectFactory.pm
@@ -20,6 +20,8 @@ our (@ISA, @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(CreateSolution CreateProject DetermineVisualStudioVersion);
+no warnings qw(redefine);
+
sub CreateSolution
{
my $visualStudioVersion = shift;
On Sun, May 27, 2018 at 11:42 AM, Andrew Dunstan
<andrew.dunstan@2ndquadrant.com> wrote:
On 05/18/2018 02:02 PM, Andrew Dunstan wrote:
These two small patches allow us to run "perl -cw" cleanly on all our perl
code.One patch silences a warning from convutils.pl about the unportability of
the literal 0x100000000. We've run for many years without this giving us a
problem, so I think we can turn the warning off pretty safely.The other patch provides a dummy library that emulates just enough of the
Win32 perl infrastructure to allow us to run these checks. That means that
Unix-based developers who might want to make changes in the msvc code can
actually run a check against their code without having to put it on a
Windows machine. The invocation goes like this (to check Mkvcbuild.pl for
example):PERL5LIB=src/tools/msvc/dummylib perl -cw src/tools/Mkvcbuild.pm
This also allows us to check src/tools/win32tzlist.pl.
In due course I'll submit a script to automate this syntax checking.
Here is the latest version of the second patch, this time with warnings
about redefinition of some subroutines suppressed. These mostly occur
because in a few cases we have multiple packages in a single file.This allows the following command to pass cleanly:
{ find . -type f -a -name '*.p[lm]' -print; find . -type f -perm
-100 -exec file {} \; -print | egrep -i ':.*perl[0-9]*\>' |cut -d:
-f1 ; } | sort -u |PERL5LIB=src/test/perl:src/test/ssl:src/bin/pg_rewind:src/backend/catalog:src/backend/utils/mb/Unicode:src/tools/msvc/dummylib:src/tools/msvc
xargs -L 1 perl -cw
Attached version actually does what's advertised above.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:
perl-warnings-fix-msvc-3.patchapplication/octet-stream; name=perl-warnings-fix-msvc-3.patchDownload
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index 27397ba..948c548 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -11,6 +11,8 @@ use strict;
use warnings;
use base qw(Project);
+no warnings qw(redefine); ## no critic
+
sub _new
{
my $classname = shift;
@@ -399,6 +401,8 @@ use strict;
use warnings;
use base qw(MSBuildProject);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -420,6 +424,8 @@ use strict;
use warnings;
use base qw(MSBuildProject);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -464,6 +470,8 @@ use strict;
use warnings;
use base qw(VC2012Project);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -487,6 +495,8 @@ use strict;
use warnings;
use base qw(VC2012Project);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -510,6 +520,8 @@ use strict;
use warnings;
use base qw(VC2012Project);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index 261c913..0d35546 100644
--- a/src/tools/msvc/Project.pm
+++ b/src/tools/msvc/Project.pm
@@ -229,6 +229,7 @@ sub AddDir
if ($filter eq "LIBOBJS")
{
+ no warnings qw(once);
if (grep(/$p/, @main::pgportfiles, @main::pgcommonfiles)
== 1)
{
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 8f0b355..7cfd5e1 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -10,6 +10,8 @@ use strict;
use warnings;
use VSObjectFactory;
+no warnings qw(redefine); ## no critic
+
sub _new
{
my $classname = shift;
@@ -768,6 +770,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -791,6 +795,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -815,6 +821,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -839,6 +847,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -863,6 +873,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -889,6 +901,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -915,6 +929,8 @@ use strict;
use warnings;
use base qw(Solution);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProject.pm
index 03b890b..09152b2 100644
--- a/src/tools/msvc/VCBuildProject.pm
+++ b/src/tools/msvc/VCBuildProject.pm
@@ -11,6 +11,8 @@ use strict;
use warnings;
use base qw(Project);
+no warnings qw(redefine); ## no critic
+
sub _new
{
my $classname = shift;
@@ -268,6 +270,8 @@ use strict;
use warnings;
use base qw(VCBuildProject);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
@@ -289,6 +293,8 @@ use strict;
use warnings;
use base qw(VCBuildProject);
+no warnings qw(redefine); ## no critic
+
sub new
{
my $classname = shift;
diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm
index eea59c5..3745f8f 100644
--- a/src/tools/msvc/VSObjectFactory.pm
+++ b/src/tools/msvc/VSObjectFactory.pm
@@ -20,6 +20,8 @@ our (@ISA, @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(CreateSolution CreateProject DetermineVisualStudioVersion);
+no warnings qw(redefine); ## no critic
+
sub CreateSolution
{
my $visualStudioVersion = shift;
diff --git a/src/tools/msvc/dummylib/README b/src/tools/msvc/dummylib/README
new file mode 100644
index 0000000..7b63d0e
--- /dev/null
+++ b/src/tools/msvc/dummylib/README
@@ -0,0 +1,13 @@
+
+src/tools/msvc/dummylib
+
+This directory contains just enough of a dummy library to allow checking of
+the programs in src/tools/msvc and src/tools/win32tzlist.pl with
+perl -cw, even on machines that lack the Win32 perl infrastructure.
+
+invoke via:
+
+PERL5LIB=src/tools/msvc/dummylib perl -cw $file
+
+This is the only use that should be made of this directory. Attempting actually
+running of any programs using this library will result in a lot of grief.
diff --git a/src/tools/msvc/dummylib/Win32.pm b/src/tools/msvc/dummylib/Win32.pm
new file mode 100644
index 0000000..079e276
--- /dev/null
+++ b/src/tools/msvc/dummylib/Win32.pm
@@ -0,0 +1,4 @@
+package Win32;
+use strict;
+use warnings;
+1;
diff --git a/src/tools/msvc/dummylib/Win32/Registry.pm b/src/tools/msvc/dummylib/Win32/Registry.pm
new file mode 100644
index 0000000..12fe044
--- /dev/null
+++ b/src/tools/msvc/dummylib/Win32/Registry.pm
@@ -0,0 +1,13 @@
+package Win32::Registry;
+
+use strict;
+use warnings;
+
+use vars qw($HKEY_LOCAL_MACHINE);
+
+use Exporter ();
+our (@EXPORT,@ISA);
+@ISA = qw(Exporter);
+@EXPORT = qw($HKEY_LOCAL_MACHINE);
+
+1;
diff --git a/src/tools/msvc/dummylib/Win32API/File.pm b/src/tools/msvc/dummylib/Win32API/File.pm
new file mode 100644
index 0000000..34d2bd8
--- /dev/null
+++ b/src/tools/msvc/dummylib/Win32API/File.pm
@@ -0,0 +1,14 @@
+package Win32API::File;
+
+use strict;
+use warnings;
+
+use constant { SEM_FAILCRITICALERRORS => 1, SEM_NOGPFAULTERRORBOX => 2 };
+sub SetErrormode {};
+use Exporter;
+our(@ISA,@EXPORT_OK,%EXPORT_TAGS);
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(SetErrorMode SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX);
+%EXPORT_TAGS = (SEM_ => [qw(SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX)]);
+
+1;