svn commit: samba r6888 - in branches/tmp/pidl2/source/build/pidl: .
jelmer at samba.org
jelmer at samba.org
Wed May 18 16:43:23 GMT 2005
Author: jelmer
Date: 2005-05-18 16:43:23 +0000 (Wed, 18 May 2005)
New Revision: 6888
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6888
Log:
Initial work on getting pidl to (optionally) warn about used pidl
extensions.
Added:
branches/tmp/pidl2/source/build/pidl/compat.pm
Modified:
branches/tmp/pidl2/source/build/pidl/pidl.pl
Changeset:
Added: branches/tmp/pidl2/source/build/pidl/compat.pm
===================================================================
--- branches/tmp/pidl2/source/build/pidl/compat.pm 2005-05-18 16:17:07 UTC (rev 6887)
+++ branches/tmp/pidl2/source/build/pidl/compat.pm 2005-05-18 16:43:23 UTC (rev 6888)
@@ -0,0 +1,55 @@
+###################################################
+# IDL Compatibility checker
+# Copyright jelmer at samba.org 2005
+# released under the GNU GPL
+
+package IDLCompat;
+
+use strict;
+
+my($res);
+
+sub warning($$)
+{
+ my $l = shift;
+ my $m = shift;
+
+ print "$l->{FILE}:$l->{LINE}:$m\n";
+}
+
+sub CheckInterface($)
+{
+ my $if = shift;
+ if (util::has_property($if, "pointer_default_top")) {
+ warning($if, "pointer_default_top() is pidl-specific");
+ }
+
+ foreach my $x (@{$if->{DATA}}) {
+ if ($x->{TYPE} eq "DECLARE") {
+ warning($if, "the declare keyword is pidl-specific");
+ next;
+ }
+
+ if ($x->{TYPE} eq "TYPEDEF") {
+ if ($x->{DATA}->{TYPE} eq "UNION") {
+ if (util::has_property($x, "nodiscriminant")) {
+ warning($x, "nodiscriminant property is pidl-specific");
+ }
+ }
+ }
+ }
+}
+
+sub Check($)
+{
+ my $pidl = shift;
+ my $res = "";
+
+ foreach my $x (@{$pidl}) {
+ CheckInterface($x) if ($x->{TYPE} eq "INTERFACE");
+ }
+
+ return $res;
+}
+
+1;
Modified: branches/tmp/pidl2/source/build/pidl/pidl.pl
===================================================================
--- branches/tmp/pidl2/source/build/pidl/pidl.pl 2005-05-18 16:17:07 UTC (rev 6887)
+++ branches/tmp/pidl2/source/build/pidl/pidl.pl 2005-05-18 16:43:23 UTC (rev 6888)
@@ -29,6 +29,7 @@
use util;
use template;
use swig;
+use compat;
my($opt_help) = 0;
my($opt_parse) = 0;
@@ -47,6 +48,7 @@
my($opt_odl) = 0;
my($opt_quiet) = 0;
my($opt_output);
+my($opt_warn_compat) = 0;
my $idl_parser = new idl;
@@ -87,6 +89,7 @@
--odl accept ODL input
--dcom-proxy create DCOM proxy (implies --odl)
--com-header create header for COM interfaces (implies --odl)
+ --warn-compat warn about incompatibility with other compilers
--quiet be quiet
\n";
exit(0);
@@ -110,7 +113,8 @@
'swig' => \$opt_swig,
'dcom-proxy' => \$opt_dcom_proxy,
'com-header' => \$opt_com_header,
- 'quiet' => \$opt_quiet
+ 'quiet' => \$opt_quiet,
+ 'warn-compat' => \$opt_warn_compat
);
if ($opt_help) {
@@ -185,6 +189,10 @@
$opt_odl = 1;
}
+ if ($opt_warn_compat) {
+ IDLCompat::Check($pidl);
+ }
+
if ($opt_odl) {
$pidl = ODL::ODL2IDL($pidl);
}
More information about the samba-cvs
mailing list