Hi Paul.

I think the line still needs moving, otherwise it will probably fail some other 
day with a strange error-message, instead of the real one. ;)

The reason I think it's wrong, is that if you execute the code:

---8<-----8<-----8<-----
use strict;
show("coder");
my $prefix = '';

sub show
{
  my ($msg) = @_;
  print("$prefix$msg");
}
--->8----->8----->8-----

...Then the execution order is as follows...

show("coder");
my ($msg) = @_;
print("$prefix$msg");   <<< $prefix is undefined/undeclared/uninitialized.
my $prefix = '';

-So print will fail.

To me, it's quite clear that $prefix is meant to be initialized to an empty 
string, and then later optionally set (somewhere).

... So the following lines ...

my $sanitise_quote = '';

my $av_preprocessor = 0;
my $av_pending;
my @av_paren_type;
my $av_pend_colon;

my $prefix = '';

... should all be moved to the top somewhere; they're never executed where they 
are located currently.

... It might (for clarification) also be a good idea to move the subroutines...
        help, build_types and deparenthesize
... down below the 'exit($exit);' line.


Love
Jens

On Thu, 27 Nov 2014 10:55:09 +0300, Paul Fertser wrote:
> Hi Jens,
> 
> On Thu, Nov 27, 2014 at 08:51:13AM +0100, Jens Bauer wrote:
>> Try moving the line ...
>> my $prefix = '';
>> ... to the top of the file (it's not very useful at line 1243 anyway)
> 
> Nope, I do not think so. I guess I know the reason, will push out
> shortly.
> 
> Thank you for caring!
> 
> -- 
> Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
> mailto:[email protected]

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to