Skip to content
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

Suppress a compiler warning on GCC in process.c #7580

Merged
merged 1 commit into from Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions process.c
Expand Up @@ -9058,7 +9058,15 @@ Init_process(void)
/* pid_t must be signed, since fork() can return -1 */
const rb_pid_t half_max_pidt = (rb_pid_t)1 << (sizeof(rb_pid_t) * CHAR_BIT - 2);
const rb_pid_t max_pidt = 2 * (half_max_pidt - 1) + 1;

/* rb_pid_t is 32 bits on some platforms, which will cause a warning on GCC
* due to POSFIXABLE always returning true. */
RBIMPL_WARNING_PUSH()
#if RBIMPL_COMPILER_IS(GCC)
RBIMPL_WARNING_IGNORED(-Wtype-limits)
#endif
if (!POSFIXABLE(max_pidt)) rb_gc_register_address(&cached_pid);
RBIMPL_WARNING_POP()

InitVM(process);
}