[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gawk doesn't treat '018' as decimal 18
From: |
Arkadiusz Drabczyk |
Subject: |
gawk doesn't treat '018' as decimal 18 |
Date: |
Sat, 9 Jan 2021 17:44:53 +0100 |
In gawk.info it says:
"Unlike in some early C implementations, '8' and '9' are not valid in
octal constants. For example, 'gawk' treats '018' as decimal 18:
$ gawk 'BEGIN { print "021 is", 021 ; print 018 }'
-| 021 is 17
-| 18
"
but I cannot reproduce it wit gawk built from today's master:
$ ./gawk 'BEGIN { print "021 is", 021 ; print 018 }'
021 is 17
0
However, I can reproduce it after going back to commit
85c0d5edb781c9f31b79e48452b1ca68643f41de so something must have
changed.
Is this a bug in gawk or in the docs?
--
Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
- gawk doesn't treat '018' as decimal 18,
Arkadiusz Drabczyk <=