Silence compiler warnings in ext/sockets/conversions.c (#10974)

These values will be initialised, but the compiler can't see it.
Write a dummy value to silence this.

Closes GH-10959.
This commit is contained in:
Niels Dossche 2023-03-29 22:18:29 +02:00 committed by GitHub
parent 717f460fa4
commit b606e44abc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -726,6 +726,7 @@ static void from_zval_write_sockaddr_aux(const zval *container,
&& Z_TYPE_P(elem) != IS_NULL) { && Z_TYPE_P(elem) != IS_NULL) {
const char *node = "family"; const char *node = "family";
zend_llist_add_element(&ctx->keys, &node); zend_llist_add_element(&ctx->keys, &node);
family = 0; /* Silence compiler warning */
from_zval_write_int(elem, (char*)&family, ctx); from_zval_write_int(elem, (char*)&family, ctx);
zend_llist_remove_tail(&ctx->keys); zend_llist_remove_tail(&ctx->keys);
@ -1121,7 +1122,7 @@ static void from_zval_write_iov_array(const zval *arr, char *msghdr_c, ser_conte
static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_context *ctx) static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_context *ctx)
{ {
struct msghdr *msghdr = (struct msghdr *)msghdr_c; struct msghdr *msghdr = (struct msghdr *)msghdr_c;
uint32_t len; uint32_t len = 0; /* Silence compiler warning */
/* controllen should be an unsigned with at least 32-bit. Let's assume /* controllen should be an unsigned with at least 32-bit. Let's assume
* this least common denominator * this least common denominator