NetBSD-Bugs archive

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

Re: bin/47840: awk string comparison of integer constant



The following reply was made to PR bin/47840; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/47840: awk string comparison of integer constant
Date: Fri, 24 May 2013 07:51:55 +0000

 On Mon, May 20, 2013 at 11:05:03PM +0000, Valery Ushakov wrote:
  >  > Note that k < 10 is evaluated as a string comparison.
  >  > 
  >  > Is this required by some standard? gawk does the same thing, but it
  >  > definitely violates the POLA.
  >  
  >  Hmm, it does, indeed, but [...]
 
 Blah... all right then, can we at least warn if a numeric constant
 gets converted to a string value like this? It is reasonable to
 suppose that if I (or anyone else) intended a string value I would
 have written a string constant.
 
 The behavior I've just exhibited is just as nonsensical as that cited
 in that RATIONALE.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 



Home | Main Index | Thread Index | Old Index