Skip to content
This repository has been archived by the owner. It is now read-only.

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

Closed
llvmbot opened this issue Aug 25, 2017 · 8 comments
Closed

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

llvmbot opened this issue Aug 25, 2017 · 8 comments
Assignees

Comments

@llvmbot
Copy link
Collaborator

@llvmbot 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 llvmbot commented Aug 25, 2017

assigned to @mclow

Loading

@mclow
Copy link

@mclow 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.

Loading

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Aug 28, 2017

Loading

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Aug 28, 2017

Loading

@llvmbot
Copy link
Collaborator Author

@llvmbot 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

Loading

@mclow
Copy link

@mclow 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.

Loading

@mclow
Copy link

@mclow 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)

Loading

@llvmbot
Copy link
Collaborator Author

@llvmbot 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

Loading

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants