[Issue 675] %a format has an out-by-1 bug for denormals.

2009-02-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=675


clugd...@yahoo.com.au changed:

   What|Removed |Added

Summary|%a format is wrong for  |%a format has an out-by-1
   |denormals. [bug in DMC?]|bug for denormals.




--- Comment #1 from clugd...@yahoo.com.au  2009-02-25 02:58 ---
If x is denormal, the %La format always prints the exponent higher by 1, than
the correct value. The mantissa is always correct.


-- 



OSX stream seek/read problem

2009-02-25 Thread wade
The following code behaves differently on OSX than LINUX (DMD 1.040):

import std.stdio;
import std.stream;
import std.file;

int Lines(Stream f)
{
  int ln = 0;

  foreach (char[] line; f) ln++;
  return ln;
}

void main(char[][] args)
{
  auto f = new BufferedFile(args[1]);
  int l = Lines(f);
  f.seek(0, SeekPos.Set);
  int r = Lines(f);
  fwritef(stderr, Lines before: %d, Lines after: %d\n, l, r);
}

Results for OSX:
Lines before: 1633, Lines after: 0

Results for LINUX
Lines before: 1633, Lines after: 1633

Seek not working properly perhaps?

wade




[Issue 2689] New: seek behaves incorrectly on MAC OSX

2009-02-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2689

   Summary: seek behaves incorrectly on MAC OSX
   Product: D
   Version: 1.040
  Platform: Macintosh
OS/Version: Mac OS X
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: swadena...@gmail.com


The following code behaves differently on OSX than LINUX (DMD 1.040):

import std.stdio;
import std.stream;
import std.file;

int Lines(Stream f)
{
  int ln = 0;

  foreach (char[] line; f) ln++;
  return ln;
}

void main(char[][] args)
{
  auto f = new BufferedFile(args[1]);
  int l = Lines(f);
  f.seek(0, SeekPos.Set);
  int r = Lines(f);
  fwritef(stderr, Lines before: %d, Lines after: %d\n, l, r);
}

Results for OSX:
Lines before: 1633, Lines after: 0

Results for LINUX
Lines before: 1633, Lines after: 1633

Seek not working properly perhaps?

wade


-- 



Re: OSX stream seek/read problem

2009-02-25 Thread Kagamin
wade Wrote:

 Seek not working properly perhaps?

May be related...
http://www.opendarwin.info/opendarwin.org/en/faq/ch04.html#lseek


Re: OSX stream seek/read problem

2009-02-25 Thread Kagamin
Kagamin Wrote:

 wade Wrote:
 
  Seek not working properly perhaps?
 
 May be related...
 http://www.opendarwin.info/opendarwin.org/en/faq/ch04.html#lseek

seems like phobos needs some error handling.


[Issue 2690] New: DMD aborts with MALLOC_CHECK_ set

2009-02-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2690

   Summary: DMD aborts with MALLOC_CHECK_ set
   Product: D
   Version: 1.040
  Platform: Other
OS/Version: Linux
Status: NEW
  Keywords: ice-on-invalid-code
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: larsi...@igesund.net


I don't know how common it is, but at least Ubuntu has a standard environment
variable called MALLOC_CHECK_ which typically is set to 2. When it is set,
memory allocations are checked (it can also be set to 3). However, with DMD
1.040 this causes an Aborted message. Setting MALLOC_CHECK_ to 0 makes it
work again.

I have tried to narrow down where it happens, but I seem to fail to get it much
shorter than the following (and it seems that Exception itself from object.di
may be involved):

class PlatformException : Exception
{
this(char[] msg)
{
super(msg);
}
}
class AssertException : Exception
{
this(char[] file, size_t line)
{
super(Assertion failure,file,line);
}
this(char[] msg, char[] file, size_t line)
{
super(msg,file,line);
}
}
void setAssertHandler(int){
}

This is a regression in DMD 1.040


-- 



Re: [Issue 2690] New: DMD aborts with MALLOC_CHECK_ set

2009-02-25 Thread Lutger
Also happens in dmd 2.025

When MALLOC_CHECK_ set to 1, I get the following message:

*** glibc detected *** dmd: realloc(): invalid pointer: 0x08d2c6a8 ***
Segmentation fault



Re: [Issue 2690] New: DMD aborts with MALLOC_CHECK_ set

2009-02-25 Thread Jarrett Billingsley
On Wed, Feb 25, 2009 at 7:05 PM, Denis Koroskin 2kor...@gmail.com wrote:
 On Thu, 26 Feb 2009 02:27:43 +0300, Lutger lutger.blijdest...@gmail.com
 wrote:

 Also happens in dmd 2.025

 When MALLOC_CHECK_ set to 1, I get the following message:

 *** glibc detected *** dmd: realloc(): invalid pointer: 0x08d2c6a8 ***
 Segmentation fault


 Perhaps, you may want to post it to bugzilla, instead?

It's supposed to work, i.e. responding to the NG thread is supposed to
post to the Bugzilla as well.  It just stopped working a couple months
ago..


Re: [Issue 2690] New: DMD aborts with MALLOC_CHECK_ set

2009-02-25 Thread Denis Koroskin

On Thu, 26 Feb 2009 03:24:06 +0300, Jarrett Billingsley 
jarrett.billings...@gmail.com wrote:

On Wed, Feb 25, 2009 at 7:05 PM, Denis Koroskin 2kor...@gmail.com  
wrote:
On Thu, 26 Feb 2009 02:27:43 +0300, Lutger  
lutger.blijdest...@gmail.com

wrote:


Also happens in dmd 2.025

When MALLOC_CHECK_ set to 1, I get the following message:

*** glibc detected *** dmd: realloc(): invalid pointer: 0x08d2c6a8 ***
Segmentation fault



Perhaps, you may want to post it to bugzilla, instead?


It's supposed to work, i.e. responding to the NG thread is supposed to
post to the Bugzilla as well.  It just stopped working a couple months
ago..


Yeah, I know. That's why I suggested to re-submit the post to bugzilla. I 
actually like the way it is, it allows commenting the reports while 
sidestepping the bugzilla. This is useful if your comment is worthless anyway. 
Just like this one :)



[Issue 2691] New: Property syntax does not work with template methods

2009-02-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2691

   Summary: Property syntax does not work with template methods
   Product: D
   Version: 1.00
  Platform: PC
OS/Version: Linux
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: dhase...@gmail.com


The following example should work but instead results in an error:
Error: template doNothing!(int) is not a member of s.chain

struct Struct
{
Struct chain()
{
return *this;
}

void doNothing(T)(){}
}

void main ()
{
Struct s;
s.chain.doNothing!(int);
}


I think this limitation has existed since time immemorial, but I haven't tried
it with any dmd version before 1.00.


-- 



[Issue 2575] gdb can not show code

2009-02-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2575





--- Comment #8 from mihail.zen...@gmail.com  2009-02-25 20:46 ---
It undocumented but widely used. IMHO better use them for mangled name than
DW_AT_name. Current way violates DWARF:

Because the names of program objects described by DWARF are the names as they
appear in the source program, implementations of language translators that use
some form of mangled name (as do many implementations of C++) should use the
unmangled form of the name in the DWARF DW_AT_name attribute, including the
keyword operator (in names such as “operator +”), if present. Sequences of
multiple whitespace characters may be compressed.


--