diff options
author | sma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-06-18 13:20:00 +0000 |
---|---|---|
committer | sma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-06-18 13:20:00 +0000 |
commit | be283e02cd3c6e5f97ec8691279c8bc9c655f537 (patch) | |
tree | cc3451683edb512ec0c6be2e6fd445f25b77ac42 | |
parent | e43569fdb43b67a03301649f95d50e1ccdab2e7c (diff) | |
download | ATCD-be283e02cd3c6e5f97ec8691279c8bc9c655f537.tar.gz |
ChangeLogTag: Wed Jun 18 13:20:00 UTC 2008 Simon Massey <sma at prismtech dot com>
-rw-r--r-- | ACE/ChangeLog | 7 | ||||
-rwxr-xr-x | ACE/bin/fuzz.pl | 77 |
2 files changed, 73 insertions, 11 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 8b26a92f4d4..7a012423ade 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,10 @@ +Wed Jun 18 13:20:00 UTC 2008 Simon Massey <sma at prismtech dot com> + + * bin/fuzz.pl: + + Redo check for wide character incompatabilty ORB_init() miss-use. + Caters for multi-line ORB_init. + Wed Jun 18 12:16:48 UTC 2008 Chad Elliott <elliott_c@ociweb.com> * bin/PerlACE/Run_Test.pm: diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl index 730519ff70e..760a8e08eb4 100755 --- a/ACE/bin/fuzz.pl +++ b/ACE/bin/fuzz.pl @@ -1724,22 +1724,77 @@ sub check_for_ORB_init () foreach $file (@files_cpp, @files_inl) { if (open (FILE, $file)) { my $disable = 0; + my $multi_line; + my $not_found= 0; print "Looking at file $file\n" if $opt_d; while (<FILE>) { - if (/FUZZ\: disable check_for_ORB_init/) { - $disable = 1; - } - if (/FUZZ\: enable check_for_ORB_init/) { - $disable = 0; - } - if ($disable == 0) { - if (/\s*ORB_init\s\([^,]*,\s*0/) { - print_error ("$file:$.: ORB_init() argv of 0 requires static_cast<ACE_TCHAR **>(0)"); + if (!defined $multi_line) { + if (/FUZZ\: disable check_for_ORB_init/) { + $disable = 1; + next; + } + elsif (/FUZZ\: enable check_for_ORB_init/) { + $disable = 0; + next; } - if (/\s*ORB_init\s\([^,]*,[^,]*,\s*0\s*\)/) { - print_error ("$file:$.: ORB_init() orbID should not be 0 (don't use 3rd parameter or give as string)"); + elsif ($disable == 0) { + s/^\s+//; ## Remove leading space + s/\s*(\/\/.*)?$//; ## Remove trailling space and line comments + if (s/^([^=]*=)?\s*(CORBA\s*::\s*)?ORB_init\s*//) { + $multi_line = $_; + } + else { + next; + } } } + else + { + $_ =~ s/^\s+//; ## Remove leading space + $_ =~ s/\s*(\/\/.*)?$//; ## Remove trailling space and line comments + if ($multi_line eq "") + { + $multi_line = $_; ## Append this line to existing statement. + } + else + { + $multi_line .= ' ' . $_; ## Append this line to existing statement. + } + } + my $testing = $multi_line; + if ($testing =~ s/^\(([^\"\)]*(\"([^\"\\]*(\\.)*)\")?)*\)//) + { + # $testing has thrown away what we actually want, i.e. + # we want to ignore what's left in $testing. + + $multi_line = substr ($multi_line, 0, -length ($testing)); + $multi_line =~ s/^\(\s*//; ## Trim leading ( and space + $multi_line =~ s/\s*\)$//; ## Trim trailing space and ) + + if ($multi_line =~ s/^[^,]*,\s*//) # If this fails there is only 1 parameter (which we will ignore) + { + # 1st parameter has been removed by the above, split up remaining 2 & 3 + $multi_line =~ s/^([^,]*),?\s*//; + my $param2 = $1; + $param2 =~ s/\s+$//; # Trim trailing spaces + + print_error ("$file:$.: ORB_init() 2nd parameter requires static_cast<ACE_TCHAR **>(0)") if ($param2 eq '0'); + print_error ("$file:$.: ORB_init() 3rd parameter is redundant (default orbID or give as string)") if ($multi_line eq '0'); + # print_error ("$file:$.: ORB_init() 3rd parameter is redundant (default orbID already \"\")") if ($multi_line eq '""'); + } + + undef $multi_line; + $not_found = 0; + } + elsif ($not_found < 10) # Limit the search for ( ... ) following ORB_init to ten lines + { + ++$not_found; + } + else + { + undef $multi_line; + $not_found = 0; + } } close (FILE); } |