Skip to content

Commit a668920

Browse files
committed
Silence compiler warnings in ext/sockets/conversions.c
These values will be initialised, but the compiler can't see it. Write a dummy value to silence this. Closes phpGH-10959.
1 parent efdbb47 commit a668920

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/sockets/conversions.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ static void from_zval_write_sockaddr_aux(const zval *container,
726726
&& Z_TYPE_P(elem) != IS_NULL) {
727727
const char *node = "family";
728728
zend_llist_add_element(&ctx->keys, &node);
729+
family = 0; /* Silence compiler warning */
729730
from_zval_write_int(elem, (char*)&family, ctx);
730731
zend_llist_remove_tail(&ctx->keys);
731732

@@ -1121,7 +1122,7 @@ static void from_zval_write_iov_array(const zval *arr, char *msghdr_c, ser_conte
11211122
static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_context *ctx)
11221123
{
11231124
struct msghdr *msghdr = (struct msghdr *)msghdr_c;
1124-
uint32_t len;
1125+
uint32_t len = 0; /* Silence compiler warning */
11251126

11261127
/* controllen should be an unsigned with at least 32-bit. Let's assume
11271128
* this least common denominator

0 commit comments

Comments
 (0)