pidl: use perl warnings
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 30 Nov 2019 09:34:54 +0000 (22:34 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Dec 2019 02:53:34 +0000 (02:53 +0000)
Warnings are good. If we turn on warnings with 'use warnings', we will
see bugs that have lain latent for years.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
40 files changed:
pidl/lib/Parse/Pidl.pm
pidl/lib/Parse/Pidl/CUtil.pm
pidl/lib/Parse/Pidl/Compat.pm
pidl/lib/Parse/Pidl/Dump.pm
pidl/lib/Parse/Pidl/Expr.pm
pidl/lib/Parse/Pidl/IDL.pm
pidl/lib/Parse/Pidl/NDR.pm
pidl/lib/Parse/Pidl/ODL.pm
pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
pidl/lib/Parse/Pidl/Samba3/Template.pm
pidl/lib/Parse/Pidl/Samba4.pm
pidl/lib/Parse/Pidl/Samba4/COM/Header.pm
pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm
pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm
pidl/lib/Parse/Pidl/Samba4/Header.pm
pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
pidl/lib/Parse/Pidl/Samba4/Python.pm
pidl/lib/Parse/Pidl/Samba4/TDR.pm
pidl/lib/Parse/Pidl/Samba4/Template.pm
pidl/lib/Parse/Pidl/Typelist.pm
pidl/lib/Parse/Pidl/Util.pm
pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
pidl/lib/Parse/Pidl/Wireshark/NDR.pm
pidl/pidl
pidl/tests/Util.pm
pidl/tests/ndr_align.pl
pidl/tests/ndr_alloc.pl
pidl/tests/ndr_array.pl
pidl/tests/ndr_compat.pl
pidl/tests/ndr_fullptr.pl
pidl/tests/ndr_refptr.pl
pidl/tests/ndr_represent.pl
pidl/tests/ndr_simple.pl
pidl/tests/ndr_string.pl
pidl/tests/ndr_tagtype.pl
pidl/tests/parse_idl.pl
pidl/tests/test_util.pl

index 40e3673908e0c54d680ec3667a6cec5083b0c93e..e4c39b3d063afe22e65e4479b0a9028110acfa41 100644 (file)
@@ -12,7 +12,7 @@ require Exporter;
 @EXPORT_OK = qw(warning error fatal $VERSION);
 
 use strict;
-
+use warnings;
 use vars qw ( $VERSION );
 
 $VERSION = '0.02';
index 9deb6ee1779ab3beac27f24ea734b74f8c8f6266..ccd8fcc3d820593128b064b434dcb99329e59b5f 100644 (file)
@@ -11,6 +11,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 
 use strict;
+use warnings;
 
 sub get_pointer_to($)
 {
index b8abcb8819568d1887e456d9a6a6da8ac683b463..062a53b8beaf94b450b9c0ca8ca11a212e2cc870 100644 (file)
@@ -8,6 +8,7 @@ package Parse::Pidl::Compat;
 use Parse::Pidl qw(warning);
 use Parse::Pidl::Util qw(has_property);
 use strict;
+use warnings;
 
 use vars qw($VERSION);
 $VERSION = '0.01';
index 4e623db673a24233d2bb091e147ee1f879be6240..5d241b812c59aa16c5afac3ea7e3be7e12b41ebb 100644 (file)
@@ -27,6 +27,7 @@ $VERSION = '0.01';
 @EXPORT_OK = qw(DumpType DumpTypedef DumpStruct DumpEnum DumpBitmap DumpUnion DumpFunction);
 
 use strict;
+use warnings;
 use Parse::Pidl::Util qw(has_property);
 
 my($res);
index 24581d29f4902288b04a1b5b74a5db068c77e004..967d687670edfe0b55a73408daa89045f0f97fea 100644 (file)
@@ -10,6 +10,7 @@
 package Parse::Pidl::Expr;
 use vars qw ( @ISA );
 use strict;
+use warnings;
 
 @ISA= qw ( Parse::Yapp::Driver );
 use Parse::Yapp::Driver;
index 6927c892556b8bc6f5d174091b7e5c45d140b77e..28bdf2f9d8491be67f0215de2f229607cdcae0e5 100644 (file)
@@ -10,6 +10,7 @@
 package Parse::Pidl::IDL;
 use vars qw ( @ISA );
 use strict;
+use warnings;
 
 @ISA= qw ( Parse::Yapp::Driver );
 use Parse::Yapp::Driver;
index 003156e3a11ef7efce7195afe0cb4e12c4ba183d..dec5e95423089ca6d12ff38777de9bff885c3141 100644 (file)
@@ -38,6 +38,7 @@ $VERSION = '0.01';
 @EXPORT_OK = qw(GetElementLevelTable ParseElement ReturnTypeElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array);
 
 use strict;
+use warnings;
 use Parse::Pidl qw(warning fatal);
 use Parse::Pidl::Typelist qw(hasType getType typeIs expandAlias mapScalarType is_fixed_size_scalar);
 use Parse::Pidl::Util qw(has_property property_matches);
index 14e77fa93f249b6039d459bed4261b358695ded7..12f869c662e67a6585e1b16d60feb0fb82d02579 100644 (file)
@@ -10,6 +10,7 @@ use Parse::Pidl::Util qw(has_property unmake_str);
 use Parse::Pidl::Typelist qw(hasType getType);
 use File::Basename;
 use strict;
+use warnings;
 
 use vars qw($VERSION);
 $VERSION = '0.01';
index c132b552f9ac535dda32e4bb8413a08e3ca4dbfe..816440ef0330358888854ce60be0321de5cc3a0c 100644 (file)
@@ -9,6 +9,7 @@ package Parse::Pidl::Samba3::ClientNDR;
 use base Parse::Pidl::Base;
 
 use strict;
+use warnings;
 use Parse::Pidl qw(fatal warning error);
 use Parse::Pidl::Util qw(has_property ParseExpr genpad);
 use Parse::Pidl::NDR qw(ContainsPipe);
index fa7303b854340976fc9b34d253ccfcd3f08eb89e..d93d519726074a36312eecdc387ada4346fe60e1 100644 (file)
@@ -11,6 +11,7 @@ use Exporter;
 @EXPORT_OK = qw(DeclLevel);
 
 use strict;
+use warnings;
 use Parse::Pidl qw(warning error fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
 use Parse::Pidl::Util qw(ParseExpr has_property is_constant);
index d50f70623950dfd87a0851413e43961d550fd5b3..ee64aebf365bcfd14e6204a8aa1fe5afc4871cce 100644 (file)
@@ -11,6 +11,7 @@ $VERSION = '0.01';
 use Parse::Pidl::Util qw(genpad);
 
 use strict;
+use warnings;
 
 my($res);
 
index b720ab901596c125c808fb9a3e4e62249c2b1eed..6b3f221887fbc318478bebda1ff974b00192bd68 100644 (file)
@@ -14,6 +14,7 @@ use Parse::Pidl::NDR qw(GetNextLevel);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
 use Parse::Pidl qw(fatal error);
 use strict;
+use warnings;
 
 use vars qw($VERSION);
 $VERSION = '0.01';
index de7d4547a5b020cbb97f990c5f6ab7289a82c6b0..159f417236f27c375d2446ced4485462890dfb71 100644 (file)
@@ -10,6 +10,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 
 use strict;
+use warnings;
 
 sub GetArgumentProtoList($)
 {
index de050e8f8c63ffc096e7e3f50426605a7fe9aa3c..1630cf235dc969aec2e4e8ad199ce4d65d4ee9cf 100644 (file)
@@ -14,6 +14,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 
 use strict;
+use warnings;
 
 my($res);
 
index 746b384a4624739ff5900b699276199b621e1393..7198038357246121dc229240550da44d54cfd15a 100644 (file)
@@ -9,6 +9,7 @@ package Parse::Pidl::Samba4::COM::Stub;
 
 use Parse::Pidl::Util qw(has_property);
 use strict;
+use warnings;
 
 use vars qw($VERSION);
 $VERSION = '0.01';
index e9b7bee040c922db15ded9dd1db73c9a9b3b718b..b818dce30ca517a82108b8f2f3aa0799d83c074c 100644 (file)
@@ -11,6 +11,7 @@ require Exporter;
 @EXPORT_OK = qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv);
 
 use strict;
+use warnings;
 use Parse::Pidl qw(fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
 use Parse::Pidl::Util qw(has_property is_constant unmake_str ParseExpr);
index ddd757c749b209dd2c959ec305c96d5d4e3c6238..58ec389a9f3a3cc0cfefff06b074aeb49ddf753c 100644 (file)
@@ -19,6 +19,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 
 use strict;
+use warnings;
 
 sub fn_declare($$) { my ($self,$n) = @_; $self->pidl($n); $self->pidl_hdr("$n;"); }
 sub new($)
index 3ae0db22f7abf548df5c05f6518842ce304119bd..ae85f2a46bd9b9979cde160a78c7b6d376980873 100644 (file)
@@ -13,6 +13,7 @@ push @ISA, qw(Exporter);
 @EXPORT_OK = qw(check_null_pointer NeededFunction NeededElement NeededType $res NeededInterface TypeFunctionName ParseElementPrint);
 
 use strict;
+use warnings;
 use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody);
 use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid unmake_str);
 use Parse::Pidl::CUtil qw(get_pointer_to get_value_of get_array_element);
index f87975cf9398012c24608fe2761e35bb21afef20..01974ed244b2e7fde4e63e6da4dc5c6768da0441 100644 (file)
@@ -7,6 +7,7 @@
 package Parse::Pidl::Samba4::NDR::Server;
 
 use strict;
+use warnings;
 use Parse::Pidl::Util;
 
 use vars qw($VERSION);
index a50f0b54df6aad89769df525c8b02d3639433871..6f5bc69f3b8dc148d694a569ece2a2cbc5571c39 100644 (file)
@@ -7,6 +7,7 @@ package Parse::Pidl::Samba4::Python;
 use parent Parse::Pidl::Base;
 
 use strict;
+use warnings;
 use Parse::Pidl qw(warning fatal error);
 use Parse::Pidl::Typelist qw(hasType resolveType getType mapTypeName expandAlias bitmap_type_fn enum_type_fn);
 use Parse::Pidl::Util qw(has_property ParseExpr unmake_str);
index 9cb483c0ae02dc43c29dc4d437231438ad0735a0..c3282879988009a5099c7af7c22d265c74f1548d 100644 (file)
@@ -15,6 +15,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 
 use strict;
+use warnings;
 
 sub new($) {
        my ($class) = shift;
index d9fb3041163378f2d42c39c1d8cc63b05d5c5ab1..6a6755b8f57a1c7868d17529df4f2245bcdeb5ac 100644 (file)
@@ -11,6 +11,7 @@ $VERSION = '0.01';
 use Parse::Pidl::Util qw(genpad);
 
 use strict;
+use warnings;
 
 my($res);
 
index 774554f093bdc84722b8ad8c8e374f98ac148d18..2b850ffee4bb2fa0e2510ad8a79836dc6fa76239 100644 (file)
@@ -16,6 +16,7 @@ $VERSION = '0.01';
 
 use Parse::Pidl::Util qw(has_property);
 use strict;
+use warnings;
 
 my %types = ();
 
index 83e23937a87723f89b44d4b85141fbb5acaa9dc9..2bcd4e4476146f540ae347bbc79b573106b357c6 100644 (file)
@@ -11,6 +11,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 
 use strict;
+use warnings;
 
 use Parse::Pidl::Expr;
 use Parse::Pidl qw(error);
index 01a8c473c56e2a0ec595c66fcb702bcea872c6bb..7f7ef184c183fad637a7d722595d1a6965119b6c 100644 (file)
@@ -115,6 +115,7 @@ $VERSION = '0.01';
 @EXPORT_OK = qw(ReadConformance ReadConformanceFH valid_ft_type valid_base_type);
 
 use strict;
+use warnings;
 
 use Parse::Pidl qw(fatal warning error);
 use Parse::Pidl::Util qw(has_property);
index 49b0c2c33ba1080113655f7052411beb56404fe1..59cbba8251af6e3f3afa7c9a3aa33c5897b96880 100644 (file)
@@ -21,6 +21,7 @@ use Exporter;
 @EXPORT_OK = qw(field2name %res PrintIdl StripPrefixes RegisterInterfaceHandoff register_hf_field CheckUsed ProcessImport ProcessInclude find_type DumpEttList DumpEttDeclaration DumpHfList DumpHfDeclaration DumpFunctionTable register_type register_ett);
 
 use strict;
+use warnings;
 use Parse::Pidl qw(error warning);
 use Parse::Pidl::Typelist qw(getType);
 use Parse::Pidl::Util qw(has_property property_matches make_str);
index 06b0f78a4851593fe4ffc1ed5f7a204e9e509472..3f48ef8e0f4a4025e258059f9f564a910b7dcf81 100755 (executable)
--- a/pidl/pidl
+++ b/pidl/pidl
@@ -402,6 +402,7 @@ pidl README by Andrew Tridgell.
 
 
 use strict;
+use warnings;
 use FindBin qw($RealBin $Script);
 use lib "$RealBin/lib";
 use Getopt::Long;
index 86b521bf94a28b25654e4a81a2cece8856537076..a7b5a63f1fb7d42604f57f136bd57d22a76cd160 100644 (file)
@@ -9,6 +9,7 @@ require Exporter;
 @EXPORT = qw(test_samba4_ndr test_warnings test_errors);
 
 use strict;
+use warnings;
 
 use FindBin qw($RealBin);
 use lib "$RealBin/../lib";
index 1f4a0da9bbb6211ea46bd64a88546fad86454ec6..80d61158e3700eee0e5350f550ec8516a5049f02 100755 (executable)
@@ -2,6 +2,7 @@
 # NDR alignment tests
 # (C) 2005 Jelmer Vernooij. Published under the GNU GPL
 use strict;
+use warnings;
 
 use Test::More tests => 5 * 8;
 use FindBin qw($RealBin);
index 399fbd21d62c5a7854d7f2827348ac84988c2965..c708c3b53936ea4d2ec92a275c1e8212092447bf 100755 (executable)
@@ -2,6 +2,7 @@
 # NDR allocation tests
 # (C) 2005 Jelmer Vernooij. Published under the GNU GPL
 use strict;
+use warnings;
 
 use Test::More tests => 5 * 8;
 use FindBin qw($RealBin);
index 2a6b5bbd57dfc8491723e7c0c110e5b93f4ac09f..46ab83ec14c5bac7cc25c6266aedfae1ed1cb6a6 100755 (executable)
@@ -3,6 +3,7 @@
 # (C) 2005 Jelmer Vernooij <jelmer@samba.org>
 # Published under the GNU General Public License
 use strict;
+use warnings;
 
 use Test::More tests => 8;
 use FindBin qw($RealBin);
index 355e7f67323c2381222e8f768db1e6b24c374701..06f7efb40009c87d1f536a9d3ee50dd7b09d5fe1 100755 (executable)
@@ -2,6 +2,7 @@
 # (C) 2007 Jelmer Vernooij <jelmer@samba.org>
 # Published under the GNU General Public License
 use strict;
+use warnings;
 
 use Test::More tests => 2;
 use FindBin qw($RealBin);
index 4ba11b740c6e7fdb4729a4b870fc3d98bf9e3101..109b368ea22b37f408487b5bec5e72b2c4b2abb5 100755 (executable)
@@ -3,6 +3,7 @@
 # (C) 2006 Jelmer Vernooij <jelmer@samba.org>.
 # Published under the GNU General Public License.
 use strict;
+use warnings;
 
 use Test::More tests => 1 * 8;
 use FindBin qw($RealBin);
index f972611ed81cd36948aef2b66c86f203020009ee..94676a80524ec294572236bacef6ae3e8f9637c6 100755 (executable)
@@ -4,6 +4,7 @@
 # (C) 2005 Jelmer Vernooij <jelmer@samba.org>.
 # Published under the GNU General Public License.
 use strict;
+use warnings;
 
 use Test::More tests => 22 * 8;
 use FindBin qw($RealBin);
index 2d65fb92b09a836bbaa5c50276ff65f866a79636..af9a92b6a238a8cfac0890c75625d210b9a81313 100755 (executable)
@@ -2,6 +2,7 @@
 # NDR represent_as() / transmit_as() tests
 # (C) 2006 Jelmer Vernooij. Published under the GNU GPL
 use strict;
+use warnings;
 
 use Test::More tests => 2 * 8;
 use FindBin qw($RealBin);
index 15e07d569347e9c39e835f06784fdc3c983606e1..c5c32445cfd0bd23d5da4306602b575908968ee6 100755 (executable)
@@ -3,6 +3,7 @@
 # (C) 2005 Jelmer Vernooij <jelmer@samba.org>
 # Published under the GNU General Public License
 use strict;
+use warnings;
 
 use Test::More tests => 8;
 use FindBin qw($RealBin);
index 8e8b8ecbad6c46f4ff428549b67381f60f1dd307..aa5fd8b5d1d6287fdd9dbed8cbbab4f54fc41c34 100755 (executable)
@@ -3,6 +3,7 @@
 # (C) 2005 Jelmer Vernooij <jelmer@samba.org>
 # Published under the GNU General Public License
 use strict;
+use warnings;
 
 use Test::More tests => 6 * 8;
 use FindBin qw($RealBin);
index 4d6bcb53afcc3ac28192b1e4f2b3deb26d76a083..fa09cf773c14ef963992f27e246b602eb87e58b5 100755 (executable)
@@ -2,7 +2,7 @@
 # Support for tagged types
 # (C) 2005 Jelmer Vernooij. Published under the GNU GPL
 use strict;
-
+use warnings;
 use Test::More tests => 3 * 8;
 use FindBin qw($RealBin);
 use lib "$RealBin";
index 14138a37b89bdb0667ee1a15c957c35f4edb2d3e..caf701b3b7783b9ce747d7f72391939b1fe4007f 100755 (executable)
@@ -3,7 +3,7 @@
 # (C) 2005 Jelmer Vernooij <jelmer@samba.org>
 # Published under the GNU General Public License
 use strict;
-
+use warnings;
 use Test::More tests => 65 * 2 + 7;
 use FindBin qw($RealBin);
 use lib "$RealBin";
index 2d59f6283bbf14bb162ff5fb6b0101ebb1cc2b03..93addceaed4cf525d110a72661039dc38d571f4f 100755 (executable)
@@ -2,6 +2,7 @@
 # (C) 2007 Jelmer Vernooij <jelmer@samba.org>
 # Published under the GNU General Public License
 use strict;
+use warnings;
 
 use Test::More tests => 6;
 use FindBin qw($RealBin);