Skip to content

Commit ca66697

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in Zend Engine
1 parent db422a0 commit ca66697

18 files changed

+77
-34
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php-src.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/zend_API.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
884884
case 'Z': /* replace with 'z' */
885885
case 'L': /* replace with 'l' */
886886
ZEND_ASSERT(0 && "ZPP modifier no longer supported");
887+
fallthrough;
887888
default:
888889
return "unknown";
889890
}

Zend/zend_ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
20132013
break;
20142014
case ZEND_AST_PROP_ELEM:
20152015
smart_str_appendc(str, '$');
2016-
/* break missing intentionally */
2016+
fallthrough;
20172017
case ZEND_AST_CONST_ELEM:
20182018
zend_ast_export_name(str, ast->child[0], 0, indent);
20192019
APPEND_DEFAULT_VALUE(1);

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ ZEND_FUNCTION(define)
528528
val = &val_free;
529529
break;
530530
}
531-
/* no break */
531+
fallthrough;
532532
default:
533533
zval_ptr_dtor(&val_free);
534534
zend_argument_type_error(2, "cannot be an object, %s given", zend_zval_type_name(val));

Zend/zend_execute.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup(zval *ptr, uint32_t
298298
break;
299299
case BP_VAR_RW:
300300
zval_undefined_cv(var EXECUTE_DATA_CC);
301-
/* break missing intentionally */
301+
fallthrough;
302302
case BP_VAR_W:
303303
ZVAL_NULL(ptr);
304304
break;
@@ -1374,6 +1374,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type
13741374
}
13751375
case IS_UNDEF:
13761376
ZVAL_UNDEFINED_OP2();
1377+
fallthrough;
13771378
case IS_DOUBLE:
13781379
case IS_NULL:
13791380
case IS_FALSE:
@@ -2037,7 +2038,7 @@ static zend_never_inline zend_uchar slow_index_convert(HashTable *ht, const zval
20372038
if (EG(exception)) {
20382039
return IS_NULL;
20392040
}
2040-
/* break missing intentionally */
2041+
fallthrough;
20412042
}
20422043
case IS_NULL:
20432044
value->str = ZSTR_EMPTY_ALLOC();
@@ -2077,7 +2078,7 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
20772078
switch (type) {
20782079
case BP_VAR_R:
20792080
zend_undefined_offset(hval);
2080-
/* break missing intentionally */
2081+
fallthrough;
20812082
case BP_VAR_UNSET:
20822083
case BP_VAR_IS:
20832084
retval = &EG(uninitialized_zval);
@@ -2086,7 +2087,7 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
20862087
if (UNEXPECTED(zend_undefined_offset_write(ht, hval) == FAILURE)) {
20872088
return NULL;
20882089
}
2089-
/* break missing intentionally */
2090+
fallthrough;
20902091
case BP_VAR_W:
20912092
retval = zend_hash_index_add_new(ht, hval, &EG(uninitialized_zval));
20922093
break;
@@ -2104,7 +2105,7 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
21042105
switch (type) {
21052106
case BP_VAR_R:
21062107
zend_undefined_index(offset_key);
2107-
/* break missing intentionally */
2108+
fallthrough;
21082109
case BP_VAR_UNSET:
21092110
case BP_VAR_IS:
21102111
retval = &EG(uninitialized_zval);
@@ -2342,6 +2343,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
23422343
}
23432344
case IS_UNDEF:
23442345
ZVAL_UNDEFINED_OP2();
2346+
fallthrough;
23452347
case IS_DOUBLE:
23462348
case IS_NULL:
23472349
case IS_FALSE:

Zend/zend_highlight.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ ZEND_API void zend_strip(void)
184184
zend_write(" ", sizeof(" ") - 1);
185185
prev_space = 1;
186186
}
187-
/* lack of break; is intentional */
187+
fallthrough;
188188
case T_COMMENT:
189189
case T_DOC_COMMENT:
190190
ZVAL_UNDEF(&token);

0 commit comments

Comments
 (0)