Octal-like integer literals

Jonathan M Davis jmdavisProg at gmx.com
Sat Feb 11 10:43:10 PST 2012


On Saturday, February 11, 2012 10:05:40 H. S. Teoh wrote:
> On Sat, Feb 11, 2012 at 06:48:20PM +0100, Andrej Mitrovic wrote:
> > Octals are going away, the use of them in Phobos have been removed and
> > Walter confirmed this too afaik.
> 
> So the question is, how will things like "0744" and "098" be interpreted
> once octals have gone away? Will they still be rejected by the compiler?

Almost certainly, because otherwise C/C++ code which is ported to D will 
silently end up with different semantics if 0744 were treated as 744. And in 
general, C/C++ code either compiles as D code with the same semantics as it 
has in C/C++, or it does not compile as D code.

- Jonathan M Davis


More information about the Digitalmars-d mailing list