← Back to index
|
Original Bugzilla link
Bug 16396 – Octal value 08 should result in error
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2016-08-16T09:56:45Z
Last change time
2018-08-24T15:02:04Z
Assigned to
No Owner
Creator
Seb
Comments
Comment #0
by greeenify — 2016-08-16T09:56:45Z
From stack overflow:
http://stackoverflow.com/questions/38963334/why-int-x-08-is-valid-when-int-x-078-is-invalid-in-dmd
import std.stdio; int main(string[] args) { // int x = 078; // error here: radix 8 digit expected, not '8' int x = 08; // but no error here writeln("x = ", x); return 0; }
Comment #1
by schveiguy — 2018-08-24T14:51:10Z
PR:
https://github.com/dlang/dmd/pull/8612
Note that 008 correctly was diagnosed, due to a quirk in the way the literals were parsed.
Comment #2
by schveiguy — 2018-08-24T15:02:04Z
oops, I realized this is already fixed! *** This issue has been marked as a duplicate of issue 19059 ***