This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/22519] Memory and binary disk layout disagree for real*10
- From: "schnetter at uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2005 20:01:16 -0000
- Subject: [Bug fortran/22519] Memory and binary disk layout disagree for real*10
- References: <20050717123939.22519.schnetter@aei.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From schnetter at uni-tuebingen dot de 2005-07-17 20:01 -------
My argument -- which I had in my head, but didn't put down -- went as follows:
ultimately, things have to be written by a system call, and a system call is
expensive. (One system call per array element is out of the question.) Thus
we either dump the whole array to disk, byte for byte as it is in memory, or
we have to transform it into a temporary buffer and then write this buffer.
C's fwrite uses a buffer (probably), fprintf does for sure.
If you remove the padding, then you have to allocate and deallocate these
buffers and pack or unpack the array elements explicitly. Depending on your
I/O library, that may be a lot of work. And in the end you are still
incompatibly to C.
(I'm afraid we may be going to repeat a discussion here that was already held
on the mailing list.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22519