[Issue 16396] New: Octal value 08 should result in error
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Aug 16 02:56:45 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16396
Issue ID: 16396
Summary: Octal value 08 should result in error
Product: D
Version: D2
Hardware: Other
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: greeenify at gmail.com
>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;
}
--
More information about the Digitalmars-d-bugs
mailing list