isascii definition using c++11 with pnacl

741 views
Skip to first unread message

Steve Myers

unread,
Jun 16, 2014, 2:04:43 PM6/16/14
to native-cli...@googlegroups.com
Hi, 
I'm Compiling a file with c++11 and libc++ with pnacl, I'm getting errors about the inclusion of isascii:

Here is my compile line:

.. /pepper_35/toolchain/mac_pnacl/bin/pnacl-clang++ -D_LIBCPP_VERSION  -std=c++11 -stdlib=libc++ -pthread  -isystem ../pepper_35/include/newlib -I../src -I../nacl_sdk/pepper_35/include  -c myprog.cpp



In file included from ../pepper_35/toolchain/mac_pnacl/usr/include/c++/v1/iostream:38:

In file included from ../pepper_35/toolchain/mac_pnacl/usr/include/c++/v1/ios:216:

../pepper_35/toolchain/mac_pnacl/usr/include/c++/v1/__locale:590:16: error: use of undeclared identifier 'isascii'

        return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;

               ^

Is there some local variable I',m supposed to set, or a missing definition?

Any help would be appreciated.


Thanks


Steve


JF Bastien

unread,
Jun 17, 2014, 1:44:35 AM6/17/14
to native-cli...@googlegroups.com

Hi Steve,

I believe this is an issue with newlib (the C library), and can be resolved by compiling with -std=gnu++11

Sorry for the short reply I'm on my phone with crappy internet access :-)

Let us know if that works.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

Steve Myers

unread,
Jun 17, 2014, 9:32:39 AM6/17/14
to native-cli...@googlegroups.com
That did it, thanks. I was unaware that gnu had these extensions. Just to clarify, it should compile with -std=c++11, or was my code somehow not compliant?

Again, thanks

S


On Tuesday, June 17, 2014 1:44:35 AM UTC-4, JF Bastien wrote:

Hi Steve,

I believe this is an issue with newlib (the C library), and can be resolved by compiling with -std=gnu++11

Sorry for the short reply I'm on my phone with crappy internet access :-)

Let us know if that works.

On Jun 16, 2014 8:04 PM, "Steve Myers" <steve...@gmail.com> wrote:
Hi, 
I'm Compiling a file with c++11 and libc++ with pnacl, I'm getting errors about the inclusion of isascii:

Here is my compile line:

.. /pepper_35/toolchain/mac_pnacl/bin/pnacl-clang++ -D_LIBCPP_VERSION  -std=c++11 -stdlib=libc++ -pthread  -isystem ../pepper_35/include/newlib -I../src -I../nacl_sdk/pepper_35/include  -c myprog.cpp



In file included from ../pepper_35/toolchain/mac_pnacl/usr/include/c++/v1/iostream:38:

In file included from ../pepper_35/toolchain/mac_pnacl/usr/include/c++/v1/ios:216:

../pepper_35/toolchain/mac_pnacl/usr/include/c++/v1/__locale:590:16: error: use of undeclared identifier 'isascii'

        return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;

               ^

Is there some local variable I',m supposed to set, or a missing definition?

Any help would be appreciated.


Thanks


Steve


--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

JF Bastien

unread,
Jun 17, 2014, 9:39:24 AM6/17/14
to native-cli...@googlegroups.com
Actually isascii isn't in C99 or in C++11, so it technically is an extension. Some non-C-standard headers could contain the function, like in POSIX:


To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.

Victor Khimenko

unread,
Jun 17, 2014, 10:02:03 AM6/17/14
to Native Client Discuss

If I understand correctly it was used in the header when program was fully C++11 compliant. Thus yes, it's an error in toolchain and must be fixed. Probably not a high-priority, but still...

drin...@chromium.org

unread,
Nov 5, 2014, 12:38:24 PM11/5/14
to native-cli...@googlegroups.com
FYI, still happening on pepper_37. Including <sstream> is enough to trigger the compilation error, switching to -std=gnu++11 fixes it.

Let me know if you want me to file a crbug.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsubscri...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

JF Bastien

unread,
Nov 5, 2014, 12:52:41 PM11/5/14
to native-cli...@googlegroups.com
This is an issue with libc++: isascii isn't standard C or C++, libc++ shouldn't use it (it should have its own).

There was some recent work in upstream libc++ to fix these issues (see http://reviews.llvm.org/p/jroelofs/, he's been doing most of these) but I'm not sure this one was fixed yet. We're close to updating to LLVM 3.5 as well as updating libc++, so PNaCl will get the fix shortly after it makes it to libc++.

I think tracking the issue with libc++ is the right thing to do.

To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.

Scott Dixon

unread,
Jan 18, 2016, 1:39:59 PM1/18/16
to Native-Client-Discuss
Still a problem on pepper_46. --std=gnu++14 works around it.

Arthur Dou

unread,
Mar 22, 2017, 1:00:10 PM3/22/17
to Native-Client-Discuss

Still a problem on pepper_49, while --std=gnu++11 works.

Steve Myers於 2014年6月17日星期二 UTC+8上午2時04分43秒寫道:
Reply all
Reply to author
Forward
0 new messages