Thread overview
[Issue 1469] "alias int fpos_t" in std.c.stdio is wrong on Darwin
Sep 02, 2007
d-bugmail
Sep 03, 2007
d-bugmail
Sep 04, 2007
d-bugmail
Sep 04, 2007
d-bugmail
Sep 08, 2007
d-bugmail
Sep 08, 2007
d-bugmail
September 02, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1469


braddr@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Phobos                      |Phobos
            Product|D                           |DGCC aka GDC
            Version|2.004                       |0.24




------- Comment #1 from braddr@puremagic.com  2007-09-02 16:22 -------
Moving to the right product, dgcc aka gdc


-- 

September 03, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1469





------- Comment #2 from afb@algonet.se  2007-09-03 01:57 -------
Darwin uses "long" for fpos_t in C too, on 32-bit Mac OS X at least.

But when D starts supporting 64-bit, it does need to be changed...


-- 

September 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1469





------- Comment #3 from u.singer@gmx.net  2007-09-04 13:13 -------
(In reply to comment #2)
> Darwin uses "long" for fpos_t in C too, on 32-bit Mac OS X at least. [...]
> 

Well it did - "did" from my point of view :-) . Here are the relevant lines
from my headers (gcc 4.0.1):

/usr/include/stdio.h:
#if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)
typedef __darwin_off_t          fpos_t;
#else
typedef __int64_t               fpos_t;
#endif

/usr/include/sys/_types.h:
typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */

Admittedly, my current CPU is a PowerPC G5 (ppc970), which is a 64-bit
processor. The OS version is Mac OS X 10.4.10 (Darwin 8.10.0), but the 64-bit
definition was there  from 10.4.0 (Darwin 8.0.0) on. Opposed to this, size_t &
sizeof(void*) are (normally) still 32-bit and standard OS ABIs depend on that.
I have no idea yet what this looks like on the current Intel-CPU Macs...

I saw that there already are CPU-specific tests like "version (BigEndian)" & "version (LittleEndian)". Maybe a similar OS-independent thing to test 64-bittedness, combined with the OS, would address the problem better than a pure OS dependency.


-- 

September 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1469





------- Comment #4 from afb@algonet.se  2007-09-04 14:01 -------
Oh, it definitely should be changed eventually just like the others have been. Just that I hadn't run into the issue yet, since 64-bit support is rather new.

Usually things that vary in size (like fpos_t) would be autoconfigured and put
into configunix.d with the rest of the platform-specific stuff... (gcc.config)


-- 

September 08, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1469


dvdfrdmn@users.sf.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #5 from dvdfrdmn@users.sf.net  2007-09-07 20:08 -------
Fixed in svn rev 1469 / release 0.25.

Note that fpos_t is still wrong for Linux and possible other system.


-- 

September 08, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1469





------- Comment #6 from dvdfrdmn@users.sf.net  2007-09-07 20:19 -------
Correction: Fixed in svn rev 154


--