This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/23138] real-values print and add incorrectly (version 4.1.0 20050702, i686-pc-mingw32)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]