GNU bug report logs -
#8532
FAIL: cp/sparse-fiemap
Previous Next
Reported by: dclarke <at> blastwave.org
Date: Thu, 21 Apr 2011 17:38:01 UTC
Severity: normal
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Jim Meyering writes:
>
> Alan Curry wrote:
> >
> > Parenthesizing the ternary expression makes it happy again.
> >
> >> BTW, that syntax works for me using the latest gawk with or without -W c=
> ompat,
> >> and with the mawk and nawk programs from debian unstable.
> >
> > apt-get install original-awk
>
> Thanks.
> This patch fixes it, and I've closed the ticket.
>
> Alan, I'll wait for you to "ack" before pushing it,
> since I've listed you as the author.
Yeah, it looks right.
I looked over the POSIX grammar for awk and I believe it requires some
parentheses here, either around the whole ternary expression or around the
comparison part of it. The key is the difference between non_unary_expr and
non_unary_print_expr. The "print" version is in effect wherever a
redirection operator might appear, and it doesn't have any of the 6
comparison operators < = > <= >= !=
The ability to do a comparison (other than '>') without parentheses in
an argument to print is an extension. From a quick peek at the gawk
ChangeLog I'd guess that it happened here:
Sun Feb 2 15:32:42 2003 Stepan Kasal <kasal <at> math.cas.cz>
[...]
The redirection of print statements reworked. The idea comes from
mawk-1.3.3; much thanks to Michael Brennan!
which puts it between gawk 3.1.1 and 3.1.2.
I noticed that Dennis Clarke reports he's using gawk 3.0.1 out of
/usr/local/bin on a Debian squeeze system, which should have gawk 3.1.7
in /usr/bin. Seems like an odd thing to do. Installed the local version
a long time ago and forgot to remove it when the version in /usr/bin
surpassed it? Something like that has happened to me at least once
before.
--
Alan Curry
This bug report was last modified 14 years and 96 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.