On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
import core.stdc.stdio;
import std.algorithm : min;
extern (C) void main()
{
char[256] buf;
buf[] = '\0';
auto str = "hello world";
auto ln = min(buf.length, str.length);
buf[0..ln] = str[0..ln];
On Friday, 24 November 2017 at 05:01:17 UTC, Basile B. wrote:
On Friday, 24 November 2017 at 00:17:31 UTC, codephantom wrote:
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
If I add -noboundscheck flag all works fine.
dmd version is 2.076.1
Why -betterC flag not 'include'
On Friday, 24 November 2017 at 00:17:31 UTC, codephantom wrote:
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
If I add -noboundscheck flag all works fine.
dmd version is 2.076.1
Why -betterC flag not 'include' -noboundscheck flag?
It's bug or in some cases it's useful?
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
If I add -noboundscheck flag all works fine.
dmd version is 2.076.1
Why -betterC flag not 'include' -noboundscheck flag?
It's bug or in some cases it's useful?
Interestingly, ldc2 will compile this ok, without the
-noboundscheck
On Wednesday, 22 November 2017 at 16:57:10 UTC, Joakim wrote:
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
[...]
betterC is a new feature that's still being worked on and still
has holes in it:
https://github.com/dlang/dmd/pull/7151
I suggest you open an issue for it on
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
Hello. I try compile simple example:
import core.stdc.stdio;
import std.algorithm : min;
extern (C) void main()
{
char[256] buf;
buf[] = '\0';
auto str = "hello world";
auto ln = min(buf.length, str.length);
On Wednesday, 22 November 2017 at 15:10:40 UTC, Oleg B wrote:
Why -betterC flag not 'include' -noboundscheck flag?
-noboundscheck is extremely harmful. If -betterC implied that, it
would no longer be a better C, it would just be the same buggy C.
The compiler should perhaps inline the
Hello. I try compile simple example:
import core.stdc.stdio;
import std.algorithm : min;
extern (C) void main()
{
char[256] buf;
buf[] = '\0';
auto str = "hello world";
auto ln = min(buf.length, str.length);
buf[0..ln] = str[0..ln];
printf("%s\n", buf.ptr);
}
rdmd