Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ AS_VAR_IF([ZEND_DEBUG], [yes], [
echo " $CFLAGS" | grep ' -g' >/dev/null || CFLAGS="$CFLAGS -g"
], [AC_DEFINE([ZEND_DEBUG], [0])])

# Add -Wno-unused-but-set-global after -Wall
AX_CHECK_COMPILE_FLAG([-Wno-unused-but-set-global],
[CFLAGS="-Wno-unused-but-set-global $CFLAGS"])
AS_VAR_IF([GCC], [yes],
[CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare $CFLAGS"])

Expand Down
4 changes: 0 additions & 4 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ zend_accel_shared_globals *accel_shared_globals = NULL;
char accel_uname_id[32];
#endif
bool accel_startup_ok = false;
#ifdef __DEBUG_MESSAGES__
static const char *zps_failure_reason = NULL;
#endif
const char *zps_api_failure_reason = NULL;
bool file_cache_only = false; /* process uses file cache only */
#if ENABLE_FILE_CACHE_FALLBACK
Expand Down Expand Up @@ -3111,9 +3109,7 @@ static int accelerator_remove_cb(zend_extension *element1, zend_extension *eleme
static void zps_startup_failure(const char *reason, const char *api_reason, int (*cb)(zend_extension *, zend_extension *))
{
accel_startup_ok = false;
#ifdef __DEBUG_MESSAGES__
zps_failure_reason = reason;
#endif
zps_api_failure_reason = api_reason?api_reason:reason;
zend_llist_del_element(&zend_extensions, NULL, (int (*)(void *, void *))cb);
}
Expand Down
3 changes: 2 additions & 1 deletion ext/standard/user_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ PHP_METHOD(php_user_filter, onClose)
ZEND_PARSE_PARAMETERS_NONE();
}

static zend_class_entry *user_filter_class_entry;
static zend_class_entry *stream_bucket_class_entry;

static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
Expand All @@ -77,7 +78,7 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
PHP_MINIT_FUNCTION(user_filters)
{
/* init the filter class ancestor */
register_class_php_user_filter();
user_filter_class_entry = register_class_php_user_filter();
stream_bucket_class_entry = register_class_StreamBucket();

/* Filters will dispose of their brigades */
Expand Down
4 changes: 3 additions & 1 deletion ext/tokenizer/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#define zendcursor LANG_SCNG(yy_cursor)
#define zendlimit LANG_SCNG(yy_limit)

static zend_class_entry *php_token_ce;

/* {{{ tokenizer_module_entry */
zend_module_entry tokenizer_module_entry = {
STANDARD_MODULE_HEADER,
Expand Down Expand Up @@ -244,7 +246,7 @@ PHP_MINIT_FUNCTION(tokenizer)
{
register_tokenizer_data_symbols(module_number);
register_tokenizer_symbols(module_number);
register_class_PhpToken(zend_ce_stringable);
php_token_ce = register_class_PhpToken(zend_ce_stringable);

return SUCCESS;
}
Expand Down
51 changes: 34 additions & 17 deletions ext/zend_test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,33 @@ ZEND_DECLARE_MODULE_GLOBALS(zend_test)

static zend_class_entry *zend_test_interface;
static zend_class_entry *zend_test_class;
static zend_class_entry *zend_test_child_class;
static zend_class_entry *zend_test_gen_stub_flag_compatibility_test;
static zend_class_entry *zend_attribute_test_class;
static zend_class_entry *zend_test_trait;
static zend_class_entry *zend_test_trait_for_internal_class;
static zend_class_entry *zend_test_trait_for_internal_class2;
static zend_class_entry *zend_test_class_with_traits;
static zend_class_entry *zend_test_attribute;
static zend_class_entry *zend_test_repeatable_attribute;
static zend_class_entry *zend_test_parameter_attribute;
static zend_class_entry *zend_test_property_attribute;
static zend_class_entry *zend_test_attribute_with_arguments;
static zend_class_entry *zend_test_class_with_method_with_parameter_attribute;
static zend_class_entry *zend_test_child_class_with_method_with_parameter_attribute;
static zend_class_entry *zend_test_class_with_property_attribute;
static zend_class_entry *zend_test_forbid_dynamic_call;
static zend_class_entry *zend_test_ns_foo_class;
static zend_class_entry *zend_test_ns_unlikely_compile_error_class;
static zend_class_entry *zend_test_ns_not_unlikely_compile_error_class;
static zend_class_entry *zend_test_ns_bar_class;
static zend_class_entry *zend_test_ns2_foo_class;
static zend_class_entry *zend_test_ns2_ns_foo_class;
static zend_class_entry *zend_test_unit_enum;
static zend_class_entry *zend_test_string_enum;
static zend_class_entry *zend_test_int_enum;
static zend_class_entry *zend_test_enum_with_interface;
static zend_class_entry *zend_test_magic_call;
static zend_object_handlers zend_test_class_handlers;

static int le_throwing_resource;
Expand Down Expand Up @@ -2421,22 +2438,22 @@ PHP_MINIT_FUNCTION(zend_test)
zend_test_class->get_static_method = zend_test_class_static_method_get;
zend_test_class->default_object_handlers = &zend_test_class_handlers;

register_class__ZendTestChildClass(zend_test_class);
zend_test_child_class = register_class__ZendTestChildClass(zend_test_class);

memcpy(&zend_test_class_handlers, &std_object_handlers, sizeof(zend_object_handlers));
zend_test_class_handlers.get_method = zend_test_class_method_get;
zend_test_class_handlers.clone_obj = NULL;
zend_test_class_handlers.free_obj = zend_test_class_free_obj;
zend_test_class_handlers.offset = offsetof(zend_test_object, std);

register_class_ZendTestGenStubFlagCompatibilityTest();
zend_test_gen_stub_flag_compatibility_test = register_class_ZendTestGenStubFlagCompatibilityTest();

register_class_ZendAttributeTest();
zend_attribute_test_class = register_class_ZendAttributeTest();

register_class__ZendTestTrait();
zend_test_trait = register_class__ZendTestTrait();
zend_test_trait_for_internal_class = register_class__ZendTestTraitForInternalClass();
zend_test_trait_for_internal_class2 = register_class__ZendTestTraitForInternalClass2();
register_class__ZendTestClassWithTraits(zend_test_trait_for_internal_class, zend_test_trait_for_internal_class2);
zend_test_class_with_traits = register_class__ZendTestClassWithTraits(zend_test_trait_for_internal_class, zend_test_trait_for_internal_class2);

register_test_symbols(module_number);

Expand All @@ -2459,29 +2476,29 @@ PHP_MINIT_FUNCTION(zend_test)
zend_mark_internal_attribute(zend_test_attribute_with_arguments);

zend_test_class_with_method_with_parameter_attribute = register_class_ZendTestClassWithMethodWithParameterAttribute();
register_class_ZendTestChildClassWithMethodWithParameterAttribute(zend_test_class_with_method_with_parameter_attribute);
zend_test_child_class_with_method_with_parameter_attribute = register_class_ZendTestChildClassWithMethodWithParameterAttribute(zend_test_class_with_method_with_parameter_attribute);

zend_test_class_with_property_attribute = register_class_ZendTestClassWithPropertyAttribute();
{
zend_property_info *prop_info = zend_hash_str_find_ptr(&zend_test_class_with_property_attribute->properties_info, "attributed", sizeof("attributed") - 1);
zend_add_property_attribute(zend_test_class_with_property_attribute, prop_info, zend_test_attribute->name, 0);
}

register_class_ZendTestForbidDynamicCall();
zend_test_forbid_dynamic_call = register_class_ZendTestForbidDynamicCall();

register_class_ZendTestNS_Foo();
register_class_ZendTestNS_UnlikelyCompileError();
register_class_ZendTestNS_NotUnlikelyCompileError();
register_class_ZendTestNS_Bar();
register_class_ZendTestNS2_Foo();
register_class_ZendTestNS2_ZendSubNS_Foo();
zend_test_ns_foo_class = register_class_ZendTestNS_Foo();
zend_test_ns_unlikely_compile_error_class = register_class_ZendTestNS_UnlikelyCompileError();
zend_test_ns_not_unlikely_compile_error_class = register_class_ZendTestNS_NotUnlikelyCompileError();
zend_test_ns_bar_class = register_class_ZendTestNS_Bar();
zend_test_ns2_foo_class = register_class_ZendTestNS2_Foo();
zend_test_ns2_ns_foo_class = register_class_ZendTestNS2_ZendSubNS_Foo();

zend_test_unit_enum = register_class_ZendTestUnitEnum();
register_class_ZendTestStringEnum();
register_class_ZendTestIntEnum();
register_class_ZendTestEnumWithInterface(zend_test_interface);
zend_test_string_enum = register_class_ZendTestStringEnum();
zend_test_int_enum = register_class_ZendTestIntEnum();
zend_test_enum_with_interface = register_class_ZendTestEnumWithInterface(zend_test_interface);

register_class__ZendTestMagicCall();
zend_test_magic_call = register_class__ZendTestMagicCall();

register_class__ZendTestMagicCallForward();

Expand Down
2 changes: 1 addition & 1 deletion main/rfc1867.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static char *php_ap_getword_conf(const zend_encoding *encoding, char *str);

static php_rfc1867_encoding_translation_t php_rfc1867_encoding_translation = dummy_encoding_translation;
static php_rfc1867_get_detect_order_t php_rfc1867_get_detect_order = NULL;
ZEND_ATTRIBUTE_UNUSED static php_rfc1867_set_input_encoding_t php_rfc1867_set_input_encoding = NULL;
static php_rfc1867_set_input_encoding_t php_rfc1867_set_input_encoding = NULL;
static php_rfc1867_getword_t php_rfc1867_getword = php_ap_getword;
static php_rfc1867_getword_conf_t php_rfc1867_getword_conf = php_ap_getword_conf;
static php_rfc1867_basename_t php_rfc1867_basename = NULL;
Expand Down
Loading