Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
llvmbot opened this issue Aug 25, 2017 · 8 comments
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 25, 2017

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

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 25, 2017

assigned to @mclow

@mclow
Copy link
Contributor

mclow commented Aug 27, 2017

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 28, 2017

-E output part1

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 28, 2017

-E part2

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 28, 2017

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

@mclow
Copy link
Contributor

mclow commented Aug 29, 2017

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.

@mclow
Copy link
Contributor

mclow commented Feb 7, 2019

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

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 7, 2019

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

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants