Skip to content

Commit 18c87ce

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in LDAP extension
1 parent bdaefc3 commit 18c87ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext/ldap/ldap.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,12 +1454,16 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
14541454
case 9:
14551455
case 8:
14561456
ldap_deref = deref;
1457+
fallthrough;
14571458
case 7:
14581459
ldap_timelimit = timelimit;
1460+
fallthrough;
14591461
case 6:
14601462
ldap_sizelimit = sizelimit;
1463+
fallthrough;
14611464
case 5:
14621465
ldap_attrsonly = attrsonly;
1466+
fallthrough;
14631467
case 4:
14641468
num_attribs = zend_hash_num_elements(Z_ARRVAL_P(attrs));
14651469
ldap_attrs = safe_emalloc((num_attribs+1), sizeof(char *), 0);
@@ -1479,6 +1483,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
14791483
ldap_attrs[i] = Z_STRVAL_P(attr);
14801484
}
14811485
ldap_attrs[num_attribs] = NULL;
1486+
fallthrough;
14821487
default:
14831488
break;
14841489
}
@@ -3331,6 +3336,7 @@ PHP_FUNCTION(ldap_parse_result)
33313336
switch (myargcount) {
33323337
case 7:
33333338
_php_ldap_controls_to_array(ld->link, lserverctrls, serverctrls, 0);
3339+
fallthrough;
33343340
case 6:
33353341
referrals = zend_try_array_init(referrals);
33363342
if (!referrals) {
@@ -3344,13 +3350,15 @@ PHP_FUNCTION(ldap_parse_result)
33443350
}
33453351
ldap_memvfree((void**)lreferrals);
33463352
}
3353+
fallthrough;
33473354
case 5:
33483355
if (lerrmsg == NULL) {
33493356
ZEND_TRY_ASSIGN_REF_EMPTY_STRING(errmsg);
33503357
} else {
33513358
ZEND_TRY_ASSIGN_REF_STRING(errmsg, lerrmsg);
33523359
ldap_memfree(lerrmsg);
33533360
}
3361+
fallthrough;
33543362
case 4:
33553363
if (lmatcheddn == NULL) {
33563364
ZEND_TRY_ASSIGN_REF_EMPTY_STRING(matcheddn);
@@ -3406,6 +3414,7 @@ PHP_FUNCTION(ldap_parse_exop)
34063414
ZEND_TRY_ASSIGN_REF_STRING(retoid, lretoid);
34073415
ldap_memfree(lretoid);
34083416
}
3417+
fallthrough;
34093418
case 3:
34103419
/* use arg #3 as the data returned by the server */
34113420
if (lretdata == NULL) {

0 commit comments

Comments
 (0)