include: mask computed auth/proto bitmasks to 32 bits

GCC 15.2 warns when assigning computed "all" bitmask macros to 32-bit
flag types because negated masks expand to the full width of unsigned
long/long on 64-bit platforms.

Mask these macros to a 32-bit domain so they do not set high bits and
avoid -Woverflow/-Wconversion warnings in callers.

Reported-by: Patrick Monnerat
Fixes #20242
Closes #20416
This commit is contained in:
Arnav-Purushotam-CUBoulder 2026-01-24 10:11:14 -07:00 committed by Daniel Stenberg
parent 2f8c9812b1
commit 9b20a672b8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 9 additions and 6 deletions

View file

@ -1194,7 +1194,7 @@ static CURLcode setopt_long_proto(struct Curl_easy *data, CURLoption option,
#endif
#ifdef USE_SSH
case CURLOPT_SSH_AUTH_TYPES:
s->ssh_auth_types = (int)arg;
s->ssh_auth_types = (uint32_t)arg;
break;
case CURLOPT_NEW_DIRECTORY_PERMS:
if((arg < 0) || (arg > 0777))