This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
sys/types.h is broken for _POSIX_THREADS
- From: Renato Caldas <seventhguardian at gmail dot com>
- To: newlib at sources dot redhat dot com
- Date: Tue, 23 Feb 2010 22:41:38 +0000
- Subject: sys/types.h is broken for _POSIX_THREADS
Hello,
I've been trying to compile rtems for a few days, it always failed
with a strange error message. Now I belive I found out why: I had
compiled gcc with --enable-threads.
I managed to find one problem. In sys/types.h there is:
#if defined(_POSIX_THREADS) && !defined(__CYGWIN__)
(...)
#if defined(__XMK__)
typedef struct pthread_attr_s {
(...)
} pthread_attr_t;
(...)
#else /* !defined(__XMK__) */
typedef struct {
(...)
#endif /* !defined(__XMK__) */
(...)
} pthread_attr_t;
(...)
#endif /* defined(_POSIX_THREADS) */
This is clearly broken, because a spurious "} pthread_attr_t" is
placed in the code #if defined(__XMK__). The fix seems to be easy.
I assume thread support is severely broken, or at least severely
untested, right? If so, wouldn't it be wiser to just make sure it is
disabled?
Cheers,
Renato