bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Unstated differences between gawk and POSIX


From: Ed Morton
Subject: [bug-gawk] Unstated differences between gawk and POSIX
Date: Thu, 2 Aug 2018 10:30:59 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

When reading the POSIX standard for gawk recently (https://groups.google.com/d/msg/comp.lang.awk/qYhgpz08pN8/ihidWMLmCQAJ) I noticed a couple of cases wrt comparisons where gawk behaves differently from what [parts of] the POSIX spec say. I posted a question about it at comp.lang.awk (https://groups.google.com/d/msg/comp.lang.awk/qYhgpz08pN8/9wbMr9XKCQAJ) to see if I might be just misunderstanding the spec but that doesn't seem to be the case. The issues are:

1) POSIX states that a numeric-string vs numeric-string comparison should be a string comparison but gawks does a numeric comparison. 2) POSIX states that an uninitialized field (e.g. $3 or higher when you only have 2 input fields) should have the same value as an uninitialized array element or scalar variable and that value is zero-or-null but in a comparison gawk treats an uninitialized field as a string with value null only.

You can see the comp.lang.awk question for details and references if you're interested. I think it's POSIX that should change to match gawks behavior (which is also the behavior of at least some other awks) rather than the other way around but idk how to make that happen (yet) or if/when it will happen, nor do I know if gawk should have something documented about the differences meantime so I at least wanted to give you a heads up about the issues and you can decide if anything should change on the gawk tool or documentation side.

     Ed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]