From 8ff2bccee31a7be12f653bc533b3e76c052534f8 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Fri, 26 Jan 2007 17:45:42 +0000 Subject: Squelch some VC++ compiler warnings. Mark float literals with the "f" suffix, to distinguish them from doubles. Make some function declarations and definitions use the "const" qualifier for arguments consistently. Ignore warning 4102 ("unreferenced label"), because such warnings are always emitted by bison-generated code. Patch from Magnus Hagander. --- src/tools/msvc/Project.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/tools/msvc/Project.pm') diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm index 362611114a0..437940c2747 100644 --- a/src/tools/msvc/Project.pm +++ b/src/tools/msvc/Project.pm @@ -23,7 +23,8 @@ sub new { includes => '', defines => ';', solution => $solution, - disablewarnings => '4018;4244;4273', + disablewarnings => '4018;4244;4273;4102', + disablelinkerwarnings => '' }; bless $self; @@ -242,6 +243,13 @@ sub AddResourceFile { $self->AddFile("$dir\\win32ver.rc"); } +sub DisableLinkerWarnings { + my ($self, $warnings) = @_; + + $self->{disablelinkerwarnings} .= ';' unless ($self->{disablelinkerwarnings} eq ''); + $self->{disablelinkerwarnings} .= $warnings; +} + sub Save { my ($self) = @_; @@ -390,6 +398,9 @@ EOF GenerateMapFile="FALSE" MapFileName=".\\$cfgname\\$self->{name}\\$self->{name}.map" SubSystem="1" TargetMachine="1" EOF + if ($self->{disablelinkerwarnings}) { + print $f "\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n"; + } if ($self->{implib}) { my $l = $self->{implib}; $l =~ s/__CFGNAME__/$cfgname/g; -- cgit v1.2.3