Menu

#844 Default lconv table wrong with --unsigned-char

WSL
pending
None
Bug
later
Feature_in_WSL_4.1
False
2013-02-18
2005-10-18
Danny Smith
No

This testcase:

#include <locale.h>
#include <limits.h>
#include <assert.h>

int main( void )
{
struct lconv* p_lconv0 = localeconv();
/* ANSI says this is the default initialization
for this and several other fields, */
assert (p_lconv0->frac_digits == CHAR_MAX);
return 0;
}

suceeds if compiled with signed char (the default)
but fail if -funsigned-char is addred to compiler flags.

When compled with MS cl using /J switch (equivalent
to -funsigned-chars) the test succeeds

This is a startup code problem. Somehow, the
preprocessor define __UNSIGNED_CHAR__ needs to
trigger a call to a constructor that initializes the default
lconv fields to UCHAR_MAX,

Danny

Discussion

  • Danny Smith

    Danny Smith - 2005-10-18
    • labels: 380073 --> mingw runtime (deprecated use WSL)
    • assigned_to: earnie --> nobody
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-05
    • labels: mingw runtime (deprecated use WSL) -->
    • status: open --> pending
    • assigned_to: Earnie Boyd
    • resolution: --> later
    • category: --> Known_bugs
    • milestone: --> WSL
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-18
    • type: --> Bug
    • category: Known_bugs --> Feature_in_WSL_4.1
    • patch_attached: --> False