RTP 6.1 Problem with QCC and errno

I’m attempting to port code from 6.0 to 6.1 and the following appears to
show a problem with the contents of . This is on a standard 6.1
installation.

#include
int main() {
int i = errno;
}

QCC err.cpp
err.cpp: In function int main()': err.cpp:3: implicit declaration of function int __get_errno_ptr(…)’
err.cpp:3: invalid type argument of `unary *’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33

Inserting “using std::__get_errno_ptr(…)” into the file works around the
problem, but I can’t work out why the errno.h file fails to do this for me.
Any help much appreciated.

Ken Appleby
Soft Optics Ltd.

Ken Appleby <ken@soft-optics.co.uk> wrote:

I’m attempting to port code from 6.0 to 6.1 and the following appears to
show a problem with the contents of . This is on a standard 6.1
installation.

#include <cerrno
int main() {
int i = errno;
}

QCC err.cpp
err.cpp: In function int main()': err.cpp:3: implicit declaration of function int __get_errno_ptr(…)’
err.cpp:3: invalid type argument of `unary *’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33

Inserting “using std::__get_errno_ptr(…)” into the file works around the
problem, but I can’t work out why the errno.h file fails to do this for me.
Any help much appreciated.

Ken Appleby
Soft Optics Ltd.

I am looking into this.

GP

Graeme Peterson <gp@qnx.com> wrote:

Ken Appleby <> ken@soft-optics.co.uk> > wrote:
I’m attempting to port code from 6.0 to 6.1 and the following appears to
show a problem with the contents of . This is on a standard 6.1
installation.

#include <cerrno
int main() {
int i = errno;
}

QCC err.cpp
err.cpp: In function int main()': err.cpp:3: implicit declaration of function int __get_errno_ptr(…)’
err.cpp:3: invalid type argument of `unary *’
cc: /usr/lib/gcc-lib/ntox86/2.95.2/cc1plus error 33

Inserting “using std::__get_errno_ptr(…)” into the file works around the
problem, but I can’t work out why the errno.h file fails to do this for me.
Any help much appreciated.

Ken Appleby
Soft Optics Ltd.

I am looking into this.

GP

The bug is confirmed and fixed in house. The following diff of /usr/include/errno.h
is the fix:

$ diff errno.h /usr/include/errno.h
31c31
< #define errno (*_STD __get_errno_ptr())

#define errno (*__get_errno_ptr())

Should make it into the next release.

Regards,
GP