Skip Menu |

This queue is for tickets about the X11-Protocol CPAN distribution.

Report information
The Basics
Id: 58604
Status: new
Priority: 0/
Queue: X11-Protocol

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: unknown AllocNamedColor vs perl -w
Date: Wed, 23 Jun 2010 08:37:58 +1000
To: bug-X11-Protocol [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With X11::Protocol 0.56 and recent debian i386 perl 5.10.1 a program use strict; use warnings; use X11::Protocol; my $X = X11::Protocol->new; $X->AllocNamedColor ($X->{'default_colormap'}, 'nosuchcolour'); run as perl -w foo.pl prints Use of uninitialized value in numeric eq (==) at /usr/share/perl5/X11/Protocol.pm line 588. Protocol error: bad 15 (Name); Sequence Number 3 Opcode (85, 0) = AllocNamedColor at foo.pl line 5 The protocol error is expected due to no such colour, but I hoped it wouldn't also give an "uninitialized value" warning under the -w option.
Subject: Re: [rt.cpan.org #58604] unknown AllocNamedColor vs perl -w
Date: Sat, 30 Apr 2011 09:47:50 +1000
To: bug-X11-Protocol [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
Perhaps something like below to ensure a number. Unless the error_type is a flag and doesn't need an ==1 at all ...
--- Protocol.pm.orig 2006-10-09 06:16:30.000000000 +1000 +++ Protocol.pm 2011-04-29 16:11:49.000000000 +1000 @@ -585,8 +585,8 @@ or $self->{'ext_request'}{$major_op}[$minor_op][0]), "\n"); if ($type == 2) { $t .= " Bad value $info (" . hexi($info) . ")\n"; - } elsif ($self->{'error_type'}[$type] == 1 or - $self->{'ext_error_type'}[$type] == 1) { + } elsif (($self->{'error_type'}[$type] + || $self->{'ext_error_type'}[$type] || 0) == 1) { $t .= " Bad resource $info (" . hexi($info) . ")\n"; } return $t;