gh-82616: Add Py_IS_TYPE_SIGNED() macro (#93178)

_posixsubprocess: add a static assertion to ensure that the pid_t
type is signed.

Replace _Py_IntegralTypeSigned() with _Py_IS_TYPE_SIGNED().
This commit is contained in:
Victor Stinner 2022-05-27 15:05:35 +02:00 committed by GitHub
parent cb04a09d2d
commit 22b75d9bef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 7 deletions

View file

@ -612,8 +612,10 @@ child_exec(char *const exec_array[],
#endif
#ifdef HAVE_SETPGID
if (pgid_to_set >= 0)
static_assert(_Py_IS_TYPE_SIGNED(pid_t), "pid_t is unsigned");
if (pgid_to_set >= 0) {
POSIX_CALL(setpgid(0, pgid_to_set));
}
#endif
#ifdef HAVE_SETGROUPS