Skip to content

Commit 260cb31

Browse files
committed
Fix [-Wstrict-prototypes] warnings in MySQLi extension
errno is a global variable/macro which is implementation defined and should not be reused
1 parent 85dc24a commit 260cb31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/mysqli/mysqli_warning.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql)
129129

130130
for (;;) {
131131
zval *entry;
132-
int errno;
132+
int php_mysqli_errno;
133133

134134
mysqlnd_fetch_into(result, MYSQLND_FETCH_NUM, &row, MYSQLND_MYSQLI);
135135
if (Z_TYPE(row) != IS_ARRAY) {
@@ -142,13 +142,13 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql)
142142

143143
/* 1. Here comes the error no */
144144
entry = zend_hash_get_current_data(Z_ARRVAL(row));
145-
errno = zval_get_long(entry);
145+
php_mysqli_errno = zval_get_long(entry);
146146
zend_hash_move_forward(Z_ARRVAL(row));
147147

148148
/* 2. Here comes the reason */
149149
entry = zend_hash_get_current_data(Z_ARRVAL(row));
150150

151-
w = php_new_warning(entry, errno);
151+
w = php_new_warning(entry, php_mysqli_errno);
152152
/*
153153
Don't destroy entry, because the row destroy will decrease
154154
the refcounter. Decreased twice then mysqlnd_free_result()

0 commit comments

Comments
 (0)