Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

tango.text.Regex won't compile on linux x86_64

Moderators: kris

Posted: 12/02/08 10:29:36

When I try and compile the Regex module using gdc, I get the following error:

warning - /gdc/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.1.2/../../../../include/d/4.1.2/tango/text/Regex.d:1334: Error: implicit conversion of expression (this.next_tag - 1LU) of type ulong to uint can cause loss of data

The tango.text.Regex code that generates this is:

uint tagCount()


return next_tag-1;


This appears to be a 64-bit related problem.

Author Message

Posted: 12/05/08 19:39:20 -- Modified: 12/07/08 17:53:25 by

Exactly. The next_tag variable is size_t, so on 64-bit platforms it's 64bit (ulong). IMHO size_t should be used as much as nowhere (maybe except c code linking cases) (AFAIK D has fixed type sizes to prevent sizing hell).

EDIT: size_t is also welcome in array indexing as described here: at 32 to 64 Bit Portability section P.S. We all poor programmers are waiting on the Regex module update (or at least me ;P )

Posted: 12/07/08 19:16:08

Please try [4149] ?

Posted: 12/10/08 20:46:37

Sorry, [4155].