On Tuesday, 24 September 2019 at 21:40:47 UTC, Brett wrote:
The only issue is that buggy dynamic code can result if someone
compares the two and it will fail silently.
But, you don't know if the static array actually contains a
null-terminated string (in which case the comparison is a bug) or
On Tuesday, 24 September 2019 at 00:29:05 UTC, Vladimir Panteleev
wrote:
On Monday, 23 September 2019 at 23:22:14 UTC, Brett wrote:
I guess you are probably right... I was thinking that it would
compare up to a null terminator. Seems kinda buggy... maybe
the compiler needs to give a warning?
On Monday, 23 September 2019 at 23:22:14 UTC, Brett wrote:
I guess you are probably right... I was thinking that it would
compare up to a null terminator. Seems kinda buggy... maybe the
compiler needs to give a warning? After all, compared a fixed
size array with a dynamic array then will
On Monday, September 23, 2019 5:22:14 PM MDT Brett via Digitalmars-d-learn
wrote:
> On Monday, 23 September 2019 at 20:45:00 UTC, destructionator
>
> wrote:
> > On Mon, Sep 23, 2019 at 08:38:03PM +, Brett via
> >
> > Digitalmars-d-learn wrote:
> >> The only thing is that szExeFile is a static
On Monday, 23 September 2019 at 20:45:00 UTC, destructionator
wrote:
On Mon, Sep 23, 2019 at 08:38:03PM +, Brett via
Digitalmars-d-learn wrote:
The only thing is that szExeFile is a static
wchar array... which shouldn't effect the comparison.
are you sure about that?
with a static size,
On Monday, 23 September 2019 at 20:38:03 UTC, Brett wrote:
cast(wstring)entry.szExeFile == Name
to!wstring(entry.szExeFile) == Name
These all fail. The strings are clearly the same. I can compare
char by char and it works. latest D 2.088. The only thing is
that szExeFile is a static wchar
On Mon, Sep 23, 2019 at 08:38:03PM +, Brett via Digitalmars-d-learn wrote:
> The only thing is that szExeFile is a static
> wchar array... which shouldn't effect the comparison.
are you sure about that?
with a static size, the lengths of the two sides won't match...
cast(wstring)entry.szExeFile == Name
to!wstring(entry.szExeFile) == Name
These all fail. The strings are clearly the same. I can compare
char by char and it works. latest D 2.088. The only thing is that
szExeFile is a static wchar array... which shouldn't effect the
comparison.