OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
2.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../uclibc/pkg_patch/gcc/307-locale_facets.patch
  5. # Copyright (C) 2009 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. This patch fixes a bug into ostream::operator<<(double) due to the wrong size
  17. passed into the __convert_from_v method. The wrong size is then passed to
  18. std::snprintf function, that, on uClibc, doens't handle sized 0 buffer.
  19. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
  20. --- gcc-4.2.1/libstdc++-v3/include/bits/locale_facets.tcc 2006-10-17 18:43:47.000000000 +0200
  21. +++ gcc-4.2.1-st/libstdc++-v3/include/bits/locale_facets.tcc 2007-08-22 18:54:23.000000000 +0200
  22. @@ -1143,7 +1143,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
  23. const int __cs_size = __fixed ? __max_exp + __prec + 4
  24. : __max_digits * 2 + __prec;
  25. char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
  26. - __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
  27. + __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf,
  28. __prec, __v);
  29. #endif
  30. @@ -1777,7 +1777,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
  31. // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
  32. const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
  33. char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
  34. - int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
  35. + int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf",
  36. 0, __units);
  37. #endif
  38. string_type __digits(__len, char_type());