This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/23138] real-values print and add incorrectly (version 4.1.0 20050702, i686-pc-mingw32)
- From: "dannysmith at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2005 00:56:56 -0000
- Subject: [Bug libfortran/23138] real-values print and add incorrectly (version 4.1.0 20050702, i686-pc-mingw32)
- References: <20050729185311.23138.post@tillmann-wegst.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dannysmith at users dot sourceforge dot net 2005-07-31 00:56 -------
This may be the problem:
In mk-kinds-h.sh:
case $largest_ctype in
float) echo "#define GFC_REAL_LARGEST_FORMAT \"\"" ;;
double) echo "#define GFC_REAL_LARGEST_FORMAT \"l\"" ;;
"long double") echo "#define GFC_REAL_LARGEST_FORMAT \"L\"" ;;
*) echo "$0: Unknown type" >&2 ; exit 1 ;;
esac
Although mingw supports long double math, the native msvcrt.dll runtime printf
family does not. The 'L' format specifier is ignored and passing long doubles
to printf doesn't work at all--the values are interptreted as doubles. The
same problem occurs in libstdc++ and the unsatisfacpory hack that mingw distros
use is to cast long doubles to doubles before sending to snprintf.
Danny
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23138