Skip to content

Commit f8b06e6

Browse files
committed
Merged pull request #726
2 parents 44b818f + e734103 commit f8b06e6

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

config.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ if test "$MONGODB" != "no"; then
132132
PHP_CHECK_GCC_ARG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses")
133133
PHP_CHECK_GCC_ARG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
134134
PHP_CHECK_GCC_ARG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized")
135+
PHP_CHECK_GCC_ARG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough")
135136
PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
136137
PHP_CHECK_GCC_ARG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra")
137138
PHP_CHECK_GCC_ARG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")

phongo_compat.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@
4949
# define ARG_UNUSED
5050
#endif
5151

52+
#if defined (__GNUC__)
53+
# define PHONGO_GNUC_CHECK_VERSION(major, minor) \
54+
((__GNUC__ > (major)) || \
55+
((__GNUC__ == (major)) && (__GNUC_MINOR__ >= (minor))))
56+
#else
57+
# define PHONGO_GNUC_CHECK_VERSION(major, minor) 0
58+
#endif
59+
60+
#if PHONGO_GNUC_CHECK_VERSION(7, 0)
61+
# define PHONGO_BREAK_INTENTIONALLY_MISSING __attribute__ ((fallthrough));
62+
#else
63+
# define PHONGO_BREAK_INTENTIONALLY_MISSING
64+
#endif
65+
66+
5267
#if PHP_VERSION_ID >= 70000
5368
# define phongo_char zend_string
5469
# define phongo_long zend_long

src/bson-encode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ static void php_phongo_bson_append(bson_t *bson, php_phongo_bson_flags_t flags,
365365
}
366366
break;
367367
}
368-
/* break intentionally omitted */
368+
PHONGO_BREAK_INTENTIONALLY_MISSING
369+
369370
case IS_OBJECT: {
370371
HashTable *tmp_ht = HASH_OF(entry);
371372

0 commit comments

Comments
 (0)