www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - .mangeof make assertion error for typedefs

reply Frank Benoit <frank_DELETE_ _DELETE_drealtime.com> writes:
import std.stdio;

typedef int ti;

int main( char[][] arg )
{
  writefln( "ti=%s", ti.mangleof );
}

$ build mangle.d
gcc mangle.o -o mangle -lphobos -lpthread -lm
$ ./mangle
ti=i
Error: AssertError Failure mangle(8)
$


Especially interesting is, that if I do a writefln after the first, it is
outputed:

  writefln( "ti=%s", ti.mangleof );
  writefln( "i=%s", int.mangleof );
->
ti=i
i=i
Error: AssertError Failure mangle(10)

Frank
Dec 15 2005
parent reply Frank Benoit <frank_DELETE_ _DELETE_drealtime.com> writes:
This happens also with this:

import std.stdio;
class A{}
int main( char[][] arg ) {
    writefln( "name=%s", A.mangleof );
}
Dec 15 2005
parent reply Rick Noether <richard.noether alum.com> writes:
On Thu, 15 Dec 2005 22:59:25 +0100 Frank Benoit wrote:

 This happens also with this:
 
 import std.stdio;
 class A{}
 int main( char[][] arg ) {
     writefln( "name=%s", A.mangleof );
 }

I think you need to return an int from main(). Haven't tested ... HTH, Rick
Dec 15 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Rick Noether wrote:
 On Thu, 15 Dec 2005 22:59:25 +0100 Frank Benoit wrote:
 
 This happens also with this:

 import std.stdio;
 class A{}
 int main( char[][] arg ) {
     writefln( "name=%s", A.mangleof );
 }

I think you need to return an int from main(). Haven't tested ...

Yes. That old DMD bug that's been reported many times. digitalmars.D.bugs/3669 digitalmars.D.bugs/4124 digitalmars.D/28449 Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Dec 16 2005
parent Bruno Medeiros <daiphoenixNO SPAMlycos.com> writes:
Stewart Gordon wrote:
 Rick Noether wrote:
 
 On Thu, 15 Dec 2005 22:59:25 +0100 Frank Benoit wrote:

 This happens also with this:

 import std.stdio;
 class A{}
 int main( char[][] arg ) {
     writefln( "name=%s", A.mangleof );
 }

I think you need to return an int from main(). Haven't tested ...

Yes. That old DMD bug that's been reported many times. digitalmars.D.bugs/3669 digitalmars.D.bugs/4124 digitalmars.D/28449 Stewart.

digitalmars.D.bugs/5281 -- Bruno Medeiros - CS/E student "Certain aspects of D are a pathway to many abilities some consider to be... unnatural."
Dec 16 2005