Skip to content

Commit c99304e

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in Main folder
1 parent 5968479 commit c99304e

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ static ZEND_COLD void php_error_cb(int orig_type, const char *error_filename, co
13221322
/* bad error in module startup - no way we can live with this */
13231323
exit(-2);
13241324
}
1325-
/* no break - intentionally */
1325+
fallthrough;
13261326
case E_ERROR:
13271327
case E_RECOVERABLE_ERROR:
13281328
case E_PARSE:

main/output.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler,
485485
handler = alias(Z_STRVAL_P(output_handler), Z_STRLEN_P(output_handler), chunk_size, flags);
486486
break;
487487
}
488+
fallthrough;
488489
default:
489490
user = ecalloc(1, sizeof(php_output_handler_user_func_t));
490491
if (SUCCESS == zend_fcall_info_init(output_handler, 0, &user->fci, &user->fcc, &handler_name, &error)) {
@@ -1014,7 +1015,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
10141015
case PHP_OUTPUT_HANDLER_NO_DATA:
10151016
/* handler ate all */
10161017
php_output_context_reset(context);
1017-
/* no break */
1018+
fallthrough;
10181019
case PHP_OUTPUT_HANDLER_SUCCESS:
10191020
/* no more buffered data */
10201021
handler->buffer.used = 0;

main/snprintf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
749749
fmt++;
750750
}
751751
/* these are promoted to int, so no break */
752+
fallthrough;
752753
default:
753754
modifier = LM_STD;
754755
break;
@@ -1143,6 +1144,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
11431144
* Note that we can't point s inside fmt because the
11441145
* unknown <char> could be preceded by width etc.
11451146
*/
1147+
fallthrough;
11461148
default:
11471149
char_buf[0] = '%';
11481150
char_buf[1] = *fmt;

main/spprintf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
356356
fmt++;
357357
}
358358
/* these are promoted to int, so no break */
359+
fallthrough;
359360
default:
360361
modifier = LM_STD;
361362
break;
@@ -749,6 +750,7 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
749750
* Note that we can't point s inside fmt because the
750751
* unknown <char> could be preceded by width etc.
751752
*/
753+
fallthrough;
752754
default:
753755
char_buf[0] = '%';
754756
char_buf[1] = *fmt;

0 commit comments

Comments
 (0)