stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-217) [Windows] SIGABRT in std::locale("...") on a combined locale name
Date Wed, 28 Jun 2006 18:03:29 GMT
[Windows] SIGABRT in std::locale("...") on a combined locale name
-----------------------------------------------------------------

         Key: STDCXX-217
         URL: http://issues.apache.org/jira/browse/STDCXX-217
     Project: C++ Standard Library
        Type: Bug

  Components: 22. Localization  
    Versions: 4.1.2, 4.1.3    
 Environment: Windows
    Reporter: Martin Sebor


Moved from the Rogue Wave bug tracking database:

****Created By: sebor @ Mar 16, 2004 04:58:48 PM****
The program below aborts on Win32:

#include <clocale>
#include <cstdio>
#include <locale>

int main ()
{
    const char shortname[] =
        "ENG;NON;MSB;FRM;ENP";

    const char longname[] = {
        "LC_COLLATE=ENG;"
        "LC_CTYPE=NON;"
        "LC_MONETARY=MSB;"
        "LC_NUMERIC=FRM;"
        "LC_TIME=ENP"
    };

    const char* fullname = std::setlocale (LC_ALL, shortname);

    std::printf ("%s\n", fullname ? fullname : "(null)");

    const std::locale classic = std::locale::classic ();

    {
        const std::locale loc (shortname);

        std::printf ("%s\n", loc.name ());

        std::printf ("%s\n", classic.name ().c_str ());
    }

    fullname = std::setlocale (LC_ALL, longname);

    std::printf ("%s\n", fullname ? fullname : "(null)");

    {
        const std::locale loc (longname);

        std::printf ("%s\n", loc.name ());

        std::printf ("%s\n", classic.name ().c_str ());
    }
    

    return 0;
}

$ cl  -D_RWCONFIG=11s -Ic:\contrib\cygwin\build\sebor\dev-hal\include -I.\..\..\..\..\include
-Ic:\contrib\cygwin\build\sebor\dev-hal\tests\stdlib\locale\..\include  -Ic:\contrib\cygwin\build\sebor\dev-hal\include\ansi
-I.\..\..\..\.. -Ic:\contrib\cygwin\build\sebor\dev-hal -Ic:\contrib\cygwin\build\sebor\dev-hal\tests\stdlib\locale
-I. -nologo -GX -MLd -W3 -Zi -GA -GR -GF -GZ -c t.cpp
t.cpp
        link  -nologo /NODEFAULTLIB:libcpd /debug /LIBPATH:.\..\..\..\..\lib /OUT:t.exe t.obj
testx11s.lib tlt11s.lib std11s.lib user32.lib
$ t.exe
English_United States.1252
LC_COLLATE=ENG;LC_CTYPE=Norw;LC_MONETARY=Malay_Bru;LC_NUMERIC=French_Principality;LC_TIME=English_Republic
of the Philippines.125;LC_COLLATE=English_United States.1252
C
LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=Norwegian-Nynorsk_Norway.1252;LC_MONETARY=Malay_Brunei
Darussalam.1252;LC_NUMERIC=French_Principality of Monaco.1252;LC_TIME=English_Republic of
the Philippines.1252
c:\contrib\cygwin\build\sebor\dev-hal\source\stdlib\locale_body.cpp:669: int __cdecl __rw::cmplocale(const
void *,const void *): Assertion '0 != plocale->_C_get_name ()' failed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message