[ 
https://issues.apache.org/jira/browse/STDCXX-824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585198#action_12585198
 ] 

Martin Sebor commented on STDCXX-824:
-------------------------------------

Do we really want the library to fail to build when there's no integer type big 
enough to fit a pointer? I would rather get incorrect results for this IMO 
fairly rare use case than not be able to use the library at all.

Btw., it seems that it should be possible to format and parse the "value" of an 
arbitrarily large object as if it were an integer by treating it as an array of 
{{unsigned char}} and formatting/parsing the elements of the array. But that 
would be an enhancement, not a bug fix (feel free to open an issue for it).

My suggestion for now is to change the first hunk of the patch like so
{noformat}
#if defined (_RWSTD_LONG_LONG) && _RWSTD_PTR_SIZE >= _RWSTD_LLONG_SIZE
    // assume pointers fit into long long
    val.ull = _RW::__rw_strtoull (buf, &err, base);
#else
    val.ul = _RW::__rw_strtoul (buf, &err, base);
#endif
{noformat}

> [MSVC x64] num_get facet reads void* type as unsigned long on all platforms 
> including LLP64
> -------------------------------------------------------------------------------------------
>
>                 Key: STDCXX-824
>                 URL: https://issues.apache.org/jira/browse/STDCXX-824
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: LLP64 platforms
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>             Fix For: 4.2.1
>
>         Attachments: num_get.cpp.diff
>
>   Original Estimate: 3h
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> The 22.locale.num.get.mt test fail on assertion when void* type has been 
> tested.
> The problem in that value for 64-bit void* type is extracted from buf as 
> 32-bit unsigned long type.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to