Skip to content

[libc] pthread_setspecific has wrong fn signature in generated header #124032

@nickdesaulniers

Description

@nickdesaulniers

impl looks correct, generated header looks incorrect:

void * pthread_setspecific(pthread_key_t, const void *) __NOEXCEPT;

fix libc/include/pthread.yaml for pthread_setspecific should return int, not void*.

Otherwise the following error is observed when building libcxxabi against llvm-libc:

/llvm-project-main/build/include/c++/v1/__thread/support/pthread.h:216:10: error: cannot initialize return object of type 'int' with an rvalue of type 'void *'
  216 |   return pthread_setspecific(__key, __p);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions