Skip to content

VSCode claims pthread_rwlock_t is undefined due to an #ifdef in the pthreadtypes.h header file #3547

@Managor

Description

@Managor

Type: Intellisense

Describe the bug

  • OS and Version: Ubuntu 19.04
  • VS Code Version: 1.33.1
  • C/C++ Extension Version: 0.22.1
  • Other extensions you installed (and if the issue persists after disabling them): Python, PHP Intellisense, npm and ESLint which none of them should interfere with C
  • A clear and concise description of what the bug is: Intellisense claims that pthread_rwlock_t is undefined. Probably due to the header file having #if defined __USE_UNIX98 || defined __USE_XOPEN2K in front of the of the typedef. It compiles just fine so it's definitely defined.

To Reproduce
Steps to reproduce the behavior:

  1. Have the C/C++ intellisense enabled
  2. Init a rwlock with pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;
  3. The editor claims that it is not defined even if it runs through gcc compilation without an error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions