From a21ff4bc95ec4a4b40fe6ae61814272caa9ccb65 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 21 Dec 2024 10:37:36 +0000 Subject: [PATCH] ext/pdo_firebird: Fix label follow by declaration A label should be followed by a statement and not a declaration, else old gcc gives the following error: a label can only be part of a statement and a declaration is not a statement To fix this we wrap the code in the switch case block in braces. --- ext/pdo_firebird/firebird_statement.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 910b325112c52..11ae4d685039d 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -886,7 +886,7 @@ static int pdo_firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zva switch (attr) { default: return 0; - case PDO_ATTR_CURSOR_NAME: + case PDO_ATTR_CURSOR_NAME: { zend_string *str_val = zval_try_get_string(val); if (str_val == NULL) { return 0; @@ -907,6 +907,7 @@ static int pdo_firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zva memcpy(S->name, ZSTR_VAL(str_val), ZSTR_LEN(str_val) + 1); zend_string_release(str_val); break; + } } return 1; }