Skip to content

gh-134585: disable _Atomic and __thread keywords during CLion parsing phase #134625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
# error "Python's source code assumes C's unsigned char is an 8-bit type"
#endif

/*
* Disable keywords and operators that are not recognized by CLion.
*
* This is only a temporary solution until CLion correctly supports them.
*/
#ifdef __JETBRAINS_IDE__
/*
* Prevents false positives in CLion's static analysis which incorrectly
* detects _Atomic(size_t) and _Atomic(uintptr_t) as duplicated declarations
* of size_t and uintptr_t respectively.
*/
#define _Atomic(x) x

/* Ignore C99 TLS extension '__thread' keyword. */
#define __thread
#endif

// Preprocessor check for a builtin preprocessor function. Always return 0
// if __has_builtin() macro is not defined.
Expand Down
Loading