[LLVMbugs] [Bug 21937] New: src/locale.cpp's time formatting: couldn't this just use nl_langinfo_l()?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 17 01:26:19 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21937

            Bug ID: 21937
           Summary: src/locale.cpp's time formatting: couldn't this just
                    use nl_langinfo_l()?
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

In __time_get_storage<wchar_t>::__analyze() we seem to 'reverse engineer' the
internal format string used by strftime(). We format an artifical date/time
string and then parse it again to obtain the format string. The same holds for
init(), where we iteratively call strftime() to obtain the names of the days
and months.

Though impressive, such a construct is actually not needed. Information like
this can be extracted from the C library directly using nl_langinfo() or
nl_langinfo_l().

Just filing this bug to make sure this won't get lost.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141217/f7f5c698/attachment.html>


More information about the llvm-bugs mailing list