[llvm-bugs] [Bug 43456] New: __locale calls isascii, but MSVC doesn't seem to provide it in ctype.h

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 25 15:53:54 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43456

            Bug ID: 43456
           Summary: __locale calls isascii, but MSVC doesn't seem to
                    provide it in ctype.h
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

If you compile a simple file that uses <iostream> on Windows and use libc++
headers, it works, but if you add -fno-ms-compatibility, you get errors like
this:

In file included from t.cpp:2:
In file included from
../../buildtools/third_party/libc++/trunk/include/iostream:37:
In file included from
../../buildtools/third_party/libc++/trunk/include/ios:215:
../../buildtools/third_party/libc++/trunk/include/__locale(636,19): error: use
of undeclared identifier 'isascii'; did you mean 'iswascii'?
            if (!(isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m)))
                  ^
../../third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt/corecrt_wctype.h(65,37):
note: 'iswascii' declared here
_Check_return_ _ACRTIMP int __cdecl iswascii  (_In_ wint_t _C);
                                    ^

As a workaround, one can pass -D_CRT_DECLARE_NONSTDC_NAMES to the compiler to
get ctype.h to provide a definition of isascii. Ideally, libc++ would avoid
this out of the box.

See also issue 34330, which is the same thing but for newlib, which also
doesn't provide isascii out of the box.

-- 
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/20190925/43a780ee/attachment-0001.html>


More information about the llvm-bugs mailing list