Re: libc functions from c++ issues

2022-04-13 Thread Chris Johns
On 14/4/2022 1:51 pm, Joel Sherrill wrote: > On Wed, Apr 13, 2022, 9:14 PM Chris Johns > wrote: > > On 14/4/2022 6:58 am, Joel Sherrill wrote: > > When you use -std= with gcc, it says to strictly enforce that standard. > C++ is > > NOT POSIX so pthread.h

Re: libc functions from c++ issues

2022-04-13 Thread Joel Sherrill
On Wed, Apr 13, 2022, 9:14 PM Chris Johns wrote: > On 14/4/2022 6:58 am, Joel Sherrill wrote: > > When you use -std= with gcc, it says to strictly enforce that standard. > C++ is > > NOT POSIX so pthread.h prototypes aren't visible. There are some edge > cases > > where gcc isn't that strict

Re: libc functions from c++ issues

2022-04-13 Thread Chris Johns
On 14/4/2022 6:58 am, Joel Sherrill wrote: > When you use -std= with gcc, it says to strictly enforce that standard. C++ is > NOT POSIX so pthread.h prototypes aren't visible.  There are some edge cases > where gcc isn't that strict until -pedantic is turned on. Use of long long in > C++03 is an

Re: libc functions from c++ issues

2022-04-13 Thread Joel Sherrill
When you use -std= with gcc, it says to strictly enforce that standard. C++ is NOT POSIX so pthread.h prototypes aren't visible. There are some edge cases where gcc isn't that strict until -pedantic is turned on. Use of long long in C++03 is an example of that. -D_POSIX_C_SOURCE=200809 is

Re: libc functions from c++ issues

2022-04-12 Thread Karel Gardas
On 4/12/22 10:05, Chris Johns wrote: I think there is something else happening here. If I use a 4.11 compiler the `setenv` call is not seen but `pthread_kill` is. Maybe 6 is more standards compliant? I do not know. I am porting a large piece of existing code to RTEMS and that code compiles and

Re: libc functions from c++ issues

2022-04-12 Thread Chris Johns
On 12/4/2022 5:18 pm, Karel Gardas wrote: > > Not sure, but isn't usage of C headers in C++ deprecated for a long time now? > Shouldn't you use csignal and cstdlib? These functions are not defined in a C++ namespace so you are required to use C functions to use them. I am not what the rational

Re: libc functions from c++ issues

2022-04-12 Thread Karel Gardas
Not sure, but isn't usage of C headers in C++ deprecated for a long time now? Shouldn't you use csignal and cstdlib? Newlib provided for RTEMS looks to push that even a bit further by providing C++ specific stdlib.h (in include/c++ and in include/c++/tr1) which just includes cstdlib and

libc functions from c++ issues

2022-04-12 Thread Chris Johns
Hi, The following code: // aarch64-rtems6-g++ -std=c++98 -c test.o test.cpp // aarch64-rtems6-g++ -std=c++03 -c test.o test.cpp // aarch64-rtems6-g++ -std=c++11 -c test.o test.cpp // aarch64-rtems6-g++ -std=c++17 -c test.o test.cpp #include #include void t1(pthread_t thread) {