Skip to content

Commit 437774f

Browse files
committed
Fix [-Wimplicit-fallthrough] warnings in Main folder
1 parent 3e72887 commit 437774f

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
@@ -1315,7 +1315,7 @@ static ZEND_COLD void php_error_cb(int orig_type, const char *error_filename, co
13151315
/* bad error in module startup - no way we can live with this */
13161316
exit(-2);
13171317
}
1318-
/* no break - intentionally */
1318+
fallthrough;
13191319
case E_ERROR:
13201320
case E_RECOVERABLE_ERROR:
13211321
case E_PARSE:

main/output.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler,
494494
handler = alias(Z_STRVAL_P(output_handler), Z_STRLEN_P(output_handler), chunk_size, flags);
495495
break;
496496
}
497+
fallthrough;
497498
default:
498499
user = ecalloc(1, sizeof(php_output_handler_user_func_t));
499500
if (SUCCESS == zend_fcall_info_init(output_handler, 0, &user->fci, &user->fcc, &handler_name, &error)) {
@@ -1023,7 +1024,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
10231024
case PHP_OUTPUT_HANDLER_NO_DATA:
10241025
/* handler ate all */
10251026
php_output_context_reset(context);
1026-
/* no break */
1027+
fallthrough;
10271028
case PHP_OUTPUT_HANDLER_SUCCESS:
10281029
/* no more buffered data */
10291030
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, bool is_char, const char *fmt, va_
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, bool is_char, const char *fmt, va_
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, bool is_char, const char *fmt, va_
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
@@ -1075,7 +1075,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zen
10751075
//TODO: avoid reallocation???
10761076
*opened_path = zend_string_init(realpath, strlen(realpath), 0);
10771077
}
1078-
/* fall through */
1078+
fallthrough;
10791079

10801080
case PHP_STREAM_PERSISTENT_FAILURE:
10811081
efree(persistent_id);

0 commit comments

Comments
 (0)