Skip to content

Commit 09b5473

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in Main folder
1 parent 97a5e85 commit 09b5473

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
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: 3 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;
@@ -815,6 +816,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
815816
* The rest also applies to other integer formats, so fall
816817
* into that case.
817818
*/
819+
fallthrough;
818820
case 'd':
819821
case 'i':
820822
/*
@@ -1143,6 +1145,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
11431145
* Note that we can't point s inside fmt because the
11441146
* unknown <char> could be preceded by width etc.
11451147
*/
1148+
fallthrough;
11461149
default:
11471150
char_buf[0] = '%';
11481151
char_buf[1] = *fmt;

main/spprintf.c

Lines changed: 3 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;
@@ -422,6 +423,7 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
422423
* The rest also applies to other integer formats, so fall
423424
* into that case.
424425
*/
426+
fallthrough;
425427
case 'd':
426428
case 'i':
427429
/*
@@ -749,6 +751,7 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
749751
* Note that we can't point s inside fmt because the
750752
* unknown <char> could be preceded by width etc.
751753
*/
754+
fallthrough;
752755
default:
753756
char_buf[0] = '%';
754757
char_buf[1] = *fmt;

main/streams/plain_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zen
10711071
//TODO: avoid reallocation???
10721072
*opened_path = zend_string_init(realpath, strlen(realpath), 0);
10731073
}
1074-
/* fall through */
1074+
fallthrough;
10751075

10761076
case PHP_STREAM_PERSISTENT_FAILURE:
10771077
efree(persistent_id);

0 commit comments

Comments
 (0)