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 libstdc++/12859] Output of floating point value changes global lokale


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12859


paolo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |paolo at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-10-31 20:39:07
               date|                            |


------- Additional Comments From paolo at gcc dot gnu dot org  2003-10-31 20:39 -------
Hi,

I can reproduce it and construct a pure "C" testcase in this sense: in v3
we use glibc uselocale assuming the the semantics is such that the below
outputs 0, 1024, 0, 1024 *not* 0, 1024, 0, 0 !!

#define _GNU_SOURCE 1
#include <locale.h>
#include <stdio.h>

int main()
{
  __locale_t    loc_new, loc_old;
  
  printf("%d\n", isalpha(0xE4));  // 0

  setlocale ( LC_ALL, "de_DE" );
  printf("%d\n", isalpha(0xE4));  // 1024

  loc_new = newlocale(1 << LC_ALL, "C", 0);
  loc_old = uselocale(loc_new);

  printf("%d\n", isalpha(0xE4));  // 0
  
  uselocale(loc_old);

  printf("%d\n", isalpha(0xE4));  // 0 *not* 1024!

  freelocale(loc_new);
  return 0;
}

What are we doing wrong?? Why the (global) de_DE locale is not restored for
the current thread by the second uselocale?

I hope to sort this out before leaving to Nuremberg!
Paolo.


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