This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]