Sean Cavanaugh wrote: > On 5/8/2012 3:36 PM, foobar wrote: > >On Tuesday, 8 May 2012 at 19:00:01 UTC, deadalnix wrote: > >> > >>I think that goal is misunderstood. It is aimed at human being, not > >>compiler. > >> > >>If one read D code that look like C, it should be able to understand > >>it easily. I is not supped to compile with 100% exact semantic. > > > >Unfortunately that is not the case. > >The stated argument is that compiling C code with a D compiler should > >either compile exactly the same or produce a compilation error. > > Thousands of my C/C++ floating point constants are broken by the > CTFE change since as 'integer'-like float constants 31.f and won't > compile anymore, since its trying to do f(31) to them for me now . . > .
I wholeheartedly agree that breaking changes are frustrating. But especially this one was needed. What we should provide is a clear path to fix the code. In your case, search and replace using a regular expression like s/(\d+).f/\1.0f/g is the way to fix your code in less than 5 minutes I hope. Jens
