[dmd 2.090.1 linux 64-bit]
The following code does not report the correct unit test summary.
The report says 1 unit test passed.
~
shared static this() {
import core.exception;
assertHandler();
}
void
cah(string file, ulong line, string msg) nothrow {
import core.stdc.stdio:
The values of the variables here can be determined during compilation.
Should there be some kind of warning like, unsigned integer may not be
compared to a value less than zero; or there shouldn't be since the
programmer should have known what he's doing?
import std.stdio;
void f1() {
I got an error message with the following code saying:
Error: no property 'length' for type 'int[string]'
Shouldn't the error message say 'length()'?
~~~
import std.stdio;
void main() {
int[string] a;
a["one"] = 1;
a["two"] = 2;
a["three"] = 3;
auto len = a.length();
}
~~~
DMD
On Wednesday, 02 March, 2016 10:23 AM, ric maicle wrote:
Shouldn't this print 'float'?
writeln(typeof(0x123f).stringof);
Oh man, I should better sleep!
Shouldn't this print 'float'?
writeln(typeof(0x123f).stringof);
I'm currently reading about floating point literal and came to this
part:
FloatLiteral:
...
Integer ImaginarySuffix
Integer FloatSuffix ImaginarySuffix
Integer RealSuffix ImaginarySuffix
Going to the Integer link, it is defined as:
Integer:
...
Why is init allowed to be redefined but not sizeof?
dmd 2.069
import std.stdio;
struct Foo {
static int init = 5;
static int sizeof = 0;
}
void main()
{
writeln(Foo.init);
writeln(Foo.sizeof);
}
Error: variable integer.Foo.sizeof .sizeof property cannot be redefined
On Wednesday, 06 January, 2016 04:01 PM, ric maicle wrote:
Why is init allowed to be redefined but not sizeof?
dmd 2.069
import std.stdio;
struct Foo {
static int init = 5;
static int sizeof = 0;
}
void main()
{
writeln(Foo.init);
writeln(Foo.sizeof);
}
Error: variable
I was rereading the Integer Literals section and trying out some code
when I came across a couple of error messages on integer overflows.
I have reproduced the code below for reference.
void main()
{
// The maximum long value is ...807
// The following line produces an error message:
On Monday, 04 January, 2016 10:58 PM, Adam D. Ruppe wrote:
On Monday, 4 January 2016 at 14:54:29 UTC, ric maicle wrote:
0U .. 4_294_967_296U
in the table Decimal Literal Types has a typo. Shouldn't the range
end with 4_294_967_295U?
The x .. y syntax excludes y. So 0..3 covers 0, 1, 2. It
I accidentally typed an extra asterisk in the format specifier.
I know that it is wrong but the error isn't clear about what
and where the error is.
import std.stdio;
void main()
{
writef("%*10s", 100);
}
and I got the following error message(s):
$ dmd -run writef.d
On Tuesday, 17 November, 2015 03:49 AM, Ali Çehreli wrote:
On 11/16/2015 10:56 AM, ric maicle wrote:
I accidentally typed an extra asterisk in the format specifier.
I know that it is wrong but the error isn't clear about what
and where the error is.
import std.stdio;
void main()
{
On Thursday, 12 November, 2015 07:50 PM, anonymous wrote:
__traits has special syntax. The first "argument" must be from a list of
special keywords that only have special meaning in that place. You can't
put the name of a struct there, and you can't put the special keyword
anywhere else. So
I was playing with __traits and tried the code below.
Shouldn't the compiler emit a warning that I'm defining isPOD
multiple times and/or I'm defining something that is built-in
like isPOD?
// DMD64 D Compiler v2.069
import std.stdio;
struct isPOD {
bool status = false;
}
int main()
{
byte
I just noticed these multiple terminologies:
* from the compiler --help, -H refers to a 'header' file
* the compiler online page refers to it as 'D interface' file
* The generated .di file first line comment says 'D import file'
I know they refer to the same thing but how is this kind of
On Thursday, 22 October, 2015 02:50 AM, Adam D. Ruppe wrote:
Use the .exe installer and it will offer to download and install visual
studio for you as part for its process.
Sorry to ask this but could anyone please explain why Visual Studio is
required by DMD 64-bit? (I have been away far too
I'm relearning D. I'm using the reference compiler (DMD) and I am a bit
confused with how the compiler 'switches' are supposed to be used.
I find some 'switches' that require an equal (=) symbol when a value is
required to be passed in.
-boundscheck=[on|safeonly|off]
-color[=on|off]
On Tuesday, 13 October, 2015 01:46 AM, anonymous wrote:
On Monday 12 October 2015 17:38, ric maicle wrote:
I'm wondering if this small irregularity should be made consistent or
maybe I misunderstood something.
As far as I know, the difference just happened, and there is point to it.
The
On Tuesday, 13 October, 2015 02:39 AM, Ali Çehreli wrote:
If we accept that = cannot be a part of a file name then we could
support -D=ddocdir as well, but I checked and = can be used as part of a
name at least on Linux. Which may explain why those switches are not
consistent with the rest and
On Tuesday, 13 October, 2015 05:43 AM, Ali Çehreli wrote:
Perhaps those were introduced after the other ones.
I am agreeing with the other posters that we cannot fix the other ones
because if anyone used = before, it was the part of the path. (Maybe...
Never tried... :) ) So, we cannot change
On Tuesday, 13 October, 2015 06:11 AM, ric maicle wrote:
Would it be possible to deprecate the old syntax, provide notice to
all D users and make it obsolete after a year?
Please ignore. There is already a DIP filed regarding this matter.
DIP41: dmd/rdmd command line overhaul.
21 matches
Mail list logo