On 19.09.2014 17:30, Daniel Murphy wrote:
Chris wrote in message news:kcsnboocxeykhknjl...@forum.dlang.org...
Out of curiosity. dmd still produces the if statement, although it
ain't gonna happen. Same is true of DoIt.yes. I know, it's an
unlikely and marginal example.
No it doesn't
On Sunday, 21 September 2014 at 13:28:59 UTC, Rainer Schuetze
wrote:
dmd didn't do any inlining at all. It is very restrained with
inlining, you'll get much better results with GDC or LDC.
I believe the function *was* inlined, however the function was
still compiled separately and included in
Out of curiosity. dmd still produces the if statement, although
it ain't gonna happen. Same is true of DoIt.yes. I know, it's
an unlikely and marginal example.
[code]
import std.stdio;
enum DoIt {
yes,
no
}
void main() {
doit(DoIt.no);
}
void doit(DoIt flag) {
if (flag == DoIt.yes
Chris wrote in message news:kcsnboocxeykhknjl...@forum.dlang.org...
Out of curiosity. dmd still produces the if statement, although
it ain't gonna happen. Same is true of DoIt.yes. I know, it's
an unlikely and marginal example.
No it doesn't, here's main:
_Dmain:
push RBP
mov RBP,RSP
mov
On Friday, 19 September 2014 at 15:30:25 UTC, Daniel Murphy wrote:
Chris wrote in message
news:kcsnboocxeykhknjl...@forum.dlang.org...
Out of curiosity. dmd still produces the if statement,
although it ain't gonna happen. Same is true of DoIt.yes. I
know, it's an unlikely and marginal
On 07/01/2012 06:42 PM, Pierre Rouleau wrote:
Would the following rewrite of the above statement maintain the original
intent while conveying a little bit more information?
It is never a good idea to write into a string literal.
never a good idea would be too permissive and welcoming. The
On 12-07-02 4:58 AM, Ali Çehreli wrote:
On 07/01/2012 06:42 PM, Pierre Rouleau wrote:
Would the following rewrite of the above statement maintain the original
intent while conveying a little bit more information?
It is never a good idea to write into a string literal.
never a good idea
On 12-06-25 11:02 PM, Jesse Phillips wrote:
On Tuesday, 26 June 2012 at 00:56:48 UTC, Pierre Rouleau wrote:
String literals are read-only under Linux. Attempting to write to
them will cause a segment violation.
You have read this completely wrong.
OK, understood. The last two sentences of
On 12-06-26 6:34 AM, Jacob Carlborg wrote:
On 2012-06-26 02:56, Pierre Rouleau wrote:
This is still true for D1 which doesn't have immutable or const. Where
this is legal:
char[] str = asd;
str[0] = 'b'; // ok on windows, segfault on posix
Thanks for clarifying this Jacob,
--
Pierre
On 2012-06-26 02:56, Pierre Rouleau wrote:
Hi all,
inside http://dlang.org/dmd-windows.html#environment down in the section
titled Differences between Windows and Linux versions, the statement is:
String literals are read-only under Linux. Attempting to write to them
will cause a segment
Hi all,
inside http://dlang.org/dmd-windows.html#environment down in the section
titled Differences between Windows and Linux versions, the statement is:
String literals are read-only under Linux. Attempting to write to them
will cause a segment violation.
This looks like an old and
It's out of date.
Or is this statement there to want you not take the address of
a string literal and attempt to write it via a pointer?
Even then you have to actively try and break the type system
auto p = cast(char*) foo.ptr;
And if you remove the brakes from your car, you shouldn't
That being said, it does no harm (i.e. it isn't _wrong_).
On 12-06-25 9:06 PM, Bernard Helyer wrote:
That being said, it does no harm (i.e. it isn't _wrong_).
Understood, but it might be a good thing to qualify it. I am looking at
D again (D2.0) and would like to start pushing it for my group at work.
Unqualified statements like this might scare
On Tuesday, 26 June 2012 at 00:56:48 UTC, Pierre Rouleau wrote:
String literals are read-only under Linux. Attempting to write
to them will cause a segment violation.
You have read this completely wrong.
It is still true today.
Linux places string literals in Read-Only Memory, Windows does
On Tuesday, 26 June 2012 at 03:02:45 UTC, Jesse Phillips wrote:
Linux places string literals in Read-Only Memory, Windows does
not. This is OS specific behavior and does not relate to the
language in the least.
Isn't it compiler-specific behavior?
Visual C++ does this on Windows.
After all,
On Tuesday, 26 June 2012 at 03:44:17 UTC, Mehrdad wrote:
On Tuesday, 26 June 2012 at 03:02:45 UTC, Jesse Phillips wrote:
Linux places string literals in Read-Only Memory, Windows does
not. This is OS specific behavior and does not relate to the
language in the least.
Isn't it
17 matches
Mail list logo