Skip to content

error: use of undeclared identifier 'isascii' while compiling strstream.cpp #33678

Closed

Description

@llvmbot
Bugzilla Link 34330
Resolution WONTFIX
Resolved on Feb 07, 2019 14:18
Version 5.0
OS other
Attachments Build log file with error messages
Reporter LLVM Bugzilla Contributor
CC @mclow

Extended Description

I'm running into a problem building libcxx in conjunction with newlib. The attached log file contains the error messages.
^
The problem appears to be that isascii is referenced in __locale, but the include file cctype doesn't contain a definition.

__locale: return isascii(__c) ? (_tab[static_cast(__c)] & __m) !=0 : false;
__locale: __vec = isascii(__low) ? _tab[static_cast(__low)] : 0;
__locale: if (isascii(
__low) && (_tab[static_cast(__low)] & __m))
__locale: if (!(isascii(
__low) && (_tab[static_cast(*__low)] & __m)))

A definition of isascii can be found in newlib's ctype.h. What's the best way to fix this?

Thanks,
Catherine

Activity

  1. llvmbot commented on Aug 25, 2017

    @llvmbot
    MemberAuthor

    assigned to @mclow

  2. mclow commented on Aug 27, 2017

    @mclow
    Contributor

    This is odd.

    <__locale> includes (line 20), which includes <ctype.h> (line 39)

    So you should be getting the definition of isascii.

    Can you run the compile line again, removing the -c and using '-E' instead?
    That should give some preprocessed output, and we can see the exact sequence of includes.

  3. llvmbot commented on Aug 28, 2017

    @llvmbot
    MemberAuthor
  4. llvmbot commented on Aug 28, 2017

    @llvmbot
    MemberAuthor
  5. llvmbot commented on Aug 28, 2017

    @llvmbot
    MemberAuthor

    newlib's ctype.h
    After examining the -E output, I see that newlib's ctype.h is picked up. The isascii declarations are guarded, though:

    #if (__MISC_VISIBLE || __XSI_VISIBLE) && !defined _AEABI_PORTABLE
    int _EXFUN(isascii, (int __c));
    int _EXFUN(toascii, (int __c));
    #define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a')
    #define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A')
    #endif

    I don't know whether libcxx's use of isascii ought to be changed or if my defines wrt to newlib are incorrect. Do you know?

    Thanks,
    Catherine

  6. mclow commented on Aug 29, 2017

    @mclow
    Contributor

    I don't know whether libcxx's use of isascii ought to be changed or if my
    defines wrt to newlib are incorrect. Do you know?

    No; I don't know. I suspect that you should define __MISC_VISIBLE to 1.
    But I'm not a Newlib expert, so that's just a guess.

  7. mclow commented on Feb 7, 2019

    @mclow
    Contributor

    Do you have an update on this?
    Is this a newlib problem? (because I can't see anything that libc++ is doing wrong here)

  8. llvmbot commented on Feb 7, 2019

    @llvmbot
    MemberAuthor

    No, I don't have an update and I'm not currently tracking this problem. I will close it out and resubmit if we encounter in the future.

    Thanks,
    Catherine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.wontfixIssue is real, but we can't or won't fix it. Not invalid

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions