Re: Early adopters of symbol based dependencies needed
Raphael Hertzog <hertzog@debian.org> writes:
> This change was precisely meant to silence those warnings. But it looks
> like this line is problematic:
> return exists $self->{flags}{DYNAMIC} and $self->{flags}{DYNAMIC}
> and exists $self->{SONAME} and $self->{SONAME};
>
> It's parsed as:
> (return exists $self->{flags}{DYNAMIC}) and ...
>
> Replacing "and" by "&&" fixes the problem. It's weird because I'm pretty
> sure it worked before and I tested it. Anyway, it's fixed in git and
> will be in the next dpkg version.
Be careful about && because you can get the opposite problem.
exists $self->{flags}{DYNAMIC && $self->{flags}{DYNAMIC}
will be parsed as
exists ($self->{flags}{DYNAMIC && $self->{flags}{DYNAMIC})
It's often good style to always use parens with the argument to defined or
exists because they're most often the functions that get bitten by this.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: