diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 7e3033ac4bcb1..8befdd3c84251 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -123,7 +123,7 @@ jobs: configurationParameters: >- --${{ matrix.debug && 'enable' || 'disable' }}-debug --${{ matrix.zts && 'enable' || 'disable' }}-zts - ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang-16 CXX=clang++-16' || '' }} + ${{ matrix.asan && 'CFLAGS="-std=c99 -fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang-16 CXX=clang++-16' || '' }} skipSlow: ${{ matrix.asan }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c index 81136bee4daa9..8a74a2f122501 100644 --- a/TSRM/TSRM.c +++ b/TSRM/TSRM.c @@ -781,7 +781,7 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void) !defined(__HAIKU__) size_t ret; - asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0" + __asm__ ("movq _tsrm_ls_cache@gottpoff(%%rip),%0" : "=r" (ret)); return ret; #elif defined(__i386__) && defined(__GNUC__) && !defined(__FreeBSD__) && \ @@ -789,7 +789,7 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void) !defined(__HAIKU__) size_t ret; - asm ("leal _tsrm_ls_cache@ntpoff,%0" + __asm__ ("leal _tsrm_ls_cache@ntpoff,%0" : "=r" (ret)); return ret; #elif defined(__aarch64__) diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h index 237b34b2927be..41ee76ee2f5a7 100644 --- a/Zend/zend_builtin_functions.h +++ b/Zend/zend_builtin_functions.h @@ -22,12 +22,12 @@ #include "zend_types.h" -typedef struct _zval_struct zval; +struct _zval_struct; zend_result zend_startup_builtin_functions(void); BEGIN_EXTERN_C() -ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit); +ZEND_API void zend_fetch_debug_backtrace(struct _zval_struct *return_value, int skip_last, int options, int limit); END_EXTERN_C() #endif /* ZEND_BUILTIN_FUNCTIONS_H */ diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index c7e31877b5cd2..8c6bf4dec65e4 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -189,7 +189,7 @@ typedef struct _zend_live_range { uint32_t end; } zend_live_range; -typedef struct _zend_property_info zend_property_info; +struct _zend_property_info; /* Compilation context that is different for each op array. */ typedef struct _zend_oparray_context { @@ -204,7 +204,7 @@ typedef struct _zend_oparray_context { int last_brk_cont; zend_brk_cont_element *brk_cont_array; HashTable *labels; - const zend_property_info *active_property_info; + const struct _zend_property_info *active_property_info; zend_property_hook_kind active_property_hook_kind; bool in_jmp_frameless_branch; } zend_oparray_context; @@ -426,7 +426,7 @@ typedef struct _zend_property_info { HashTable *attributes; zend_class_entry *ce; zend_type type; - const zend_property_info *prototype; + const struct _zend_property_info *prototype; zend_function **hooks; } zend_property_info; diff --git a/Zend/zend_frameless_function.c b/Zend/zend_frameless_function.c index 7ccda0cfb5702..d34aaa5cf9ccd 100644 --- a/Zend/zend_frameless_function.c +++ b/Zend/zend_frameless_function.c @@ -17,6 +17,7 @@ #include #include "zend_frameless_function.h" +#include "zend_types.h" size_t zend_flf_count = 0; size_t zend_flf_capacity = 0; diff --git a/Zend/zend_frameless_function.h b/Zend/zend_frameless_function.h index d64ca7ee15e2f..f082b84cc3cd4 100644 --- a/Zend/zend_frameless_function.h +++ b/Zend/zend_frameless_function.h @@ -103,19 +103,18 @@ BEGIN_EXTERN_C() -typedef struct _zval_struct zval; -typedef struct _zend_op zend_op; -typedef union _zend_function zend_function; +struct _zval_struct; +union _zend_function; -typedef void (*zend_frameless_function_0)(zval *return_value); -typedef void (*zend_frameless_function_1)(zval *return_value, zval *op1); -typedef void (*zend_frameless_function_2)(zval *return_value, zval *op1, zval *op2); -typedef void (*zend_frameless_function_3)(zval *return_value, zval *op1, zval *op2, zval *op3); +typedef void (*zend_frameless_function_0)(struct _zval_struct *return_value); +typedef void (*zend_frameless_function_1)(struct _zval_struct *return_value, struct _zval_struct *op1); +typedef void (*zend_frameless_function_2)(struct _zval_struct *return_value, struct _zval_struct *op1, struct _zval_struct *op2); +typedef void (*zend_frameless_function_3)(struct _zval_struct *return_value, struct _zval_struct *op1, struct _zval_struct *op2, struct _zval_struct *op3); extern size_t zend_flf_count; extern size_t zend_flf_capacity; ZEND_API extern void **zend_flf_handlers; -ZEND_API extern zend_function **zend_flf_functions; +ZEND_API extern union _zend_function **zend_flf_functions; typedef struct { void *handler; diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h index 62546413c7cb2..b653f0307b723 100644 --- a/Zend/zend_ini_scanner.h +++ b/Zend/zend_ini_scanner.h @@ -22,7 +22,7 @@ #include "zend_types.h" -typedef struct _zend_file_handle zend_file_handle; +struct _zend_file_handle; /* Scanner modes */ #define ZEND_INI_SCANNER_NORMAL 0 /* Normal mode. [DEFAULT] */ @@ -32,7 +32,7 @@ typedef struct _zend_file_handle zend_file_handle; BEGIN_EXTERN_C() ZEND_COLD int zend_ini_scanner_get_lineno(void); ZEND_COLD const char *zend_ini_scanner_get_filename(void); -zend_result zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode); +zend_result zend_ini_open_file_for_scanning(struct _zend_file_handle *fh, int scanner_mode); zend_result zend_ini_prepare_string_for_scanning(const char *str, int scanner_mode); int ini_lex(zval *ini_lval); void shutdown_ini_scanner(void); diff --git a/Zend/zend_map_ptr.h b/Zend/zend_map_ptr.h index 7a0d853dbd166..75e9ca9d66576 100644 --- a/Zend/zend_map_ptr.h +++ b/Zend/zend_map_ptr.h @@ -21,7 +21,7 @@ #include "zend_portability.h" -typedef struct _zend_string zend_string; +struct _zend_string; #define ZEND_MAP_PTR_KIND_PTR 0 #define ZEND_MAP_PTR_KIND_PTR_OR_OFFSET 1 @@ -76,7 +76,7 @@ BEGIN_EXTERN_C() ZEND_API void zend_map_ptr_reset(void); ZEND_API void *zend_map_ptr_new(void); ZEND_API void zend_map_ptr_extend(size_t last); -ZEND_API void zend_alloc_ce_cache(zend_string *type_name); +ZEND_API void zend_alloc_ce_cache(struct _zend_string *type_name); END_EXTERN_C() diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 730b110eccd37..05ae3249fcf79 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -304,10 +304,10 @@ ZEND_API HashTable *zend_std_get_properties_for(zend_object *obj, zend_prop_purp * consumers of the get_properties_for API. */ ZEND_API HashTable *zend_get_properties_for(zval *obj, zend_prop_purpose purpose); -typedef struct _zend_property_info zend_property_info; +struct _zend_property_info; ZEND_API zend_function *zend_get_property_hook_trampoline( - const zend_property_info *prop_info, + const struct _zend_property_info *prop_info, zend_property_hook_kind kind, zend_string *prop_name); #define zend_release_properties(ht) do { \ diff --git a/Zend/zend_property_hooks.h b/Zend/zend_property_hooks.h index 3793fa1a683cb..d08e70906e805 100644 --- a/Zend/zend_property_hooks.h +++ b/Zend/zend_property_hooks.h @@ -23,19 +23,21 @@ BEGIN_EXTERN_C() -typedef struct _zend_array zend_array; -typedef struct _zend_class_entry zend_class_entry; -typedef struct _zend_object zend_object; -typedef struct _zend_object_iterator zend_object_iterator; -typedef struct _zval_struct zval; +/* Intentionally avoid typedef because of C99 redeclaration errors. */ +struct _zend_array; +struct _zend_class_entry; +struct _zend_object; +struct _zend_object_iterator; +struct _zval_struct; typedef enum { ZEND_PROPERTY_HOOK_GET = 0, ZEND_PROPERTY_HOOK_SET = 1, } zend_property_hook_kind; -ZEND_API zend_object_iterator *zend_hooked_object_get_iterator(zend_class_entry *ce, zval *object, int by_ref); -ZEND_API zend_array *zend_hooked_object_build_properties(zend_object *zobj); +ZEND_API struct _zend_object_iterator *zend_hooked_object_get_iterator( + struct _zend_class_entry *ce, struct _zval_struct *object, int by_ref); +ZEND_API struct _zend_array *zend_hooked_object_build_properties(struct _zend_object *zobj); END_EXTERN_C() diff --git a/Zend/zend_smart_str_public.h b/Zend/zend_smart_str_public.h index 6a3b526254e48..17ba9c33ed819 100644 --- a/Zend/zend_smart_str_public.h +++ b/Zend/zend_smart_str_public.h @@ -19,11 +19,11 @@ #include -typedef struct _zend_string zend_string; +struct _zend_string; typedef struct { /** See smart_str_extract() */ - zend_string *s; + struct _zend_string *s; size_t a; } smart_str; diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index c9c41c75c72a2..c7333280b7f90 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -21,18 +21,18 @@ #include "zend_portability.h" -typedef struct _zend_op zend_op; -typedef struct _zend_execute_data zend_execute_data; +struct _zend_op; +struct _zend_execute_data; BEGIN_EXTERN_C() -ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* opcode); -ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* opcode, uint32_t op1_info, uint32_t op2_info, uint32_t res_info); -ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op); -ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(zend_op *op); -ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *op); -ZEND_API const zend_op *zend_get_halt_op(void); -ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data *ex); +ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(struct _zend_op* opcode); +ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(struct _zend_op* opcode, uint32_t op1_info, uint32_t op2_info, uint32_t res_info); +ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(struct _zend_op *op); +ZEND_API void ZEND_FASTCALL zend_deserialize_opcode_handler(struct _zend_op *op); +ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const struct _zend_op *op); +ZEND_API const struct _zend_op *zend_get_halt_op(void); +ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(struct _zend_execute_data *ex); ZEND_API int zend_vm_kind(void); ZEND_API bool zend_gcc_global_regs(void); diff --git a/ext/bcmath/libbcmath/src/convert.c b/ext/bcmath/libbcmath/src/convert.c index bf3d9a9a415bf..a1d99b302a256 100644 --- a/ext/bcmath/libbcmath/src/convert.c +++ b/ext/bcmath/libbcmath/src/convert.c @@ -16,7 +16,6 @@ #include "bcmath.h" #include "convert.h" -#include "private.h" #ifdef __SSE2__ # include #endif diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c index 3341396236e67..49bada7f2d8e6 100644 --- a/ext/bcmath/libbcmath/src/recmul.c +++ b/ext/bcmath/libbcmath/src/recmul.c @@ -33,7 +33,6 @@ #include #include #include -#include "private.h" #include "convert.h" #include "zend_alloc.h" diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c index a46ae6a2c9d73..3595174926f4e 100644 --- a/ext/bcmath/libbcmath/src/str2num.c +++ b/ext/bcmath/libbcmath/src/str2num.c @@ -31,7 +31,6 @@ #include "bcmath.h" #include "convert.h" -#include "private.h" #include #include #ifdef __SSE2__ diff --git a/ext/dom/html5_parser.c b/ext/dom/html5_parser.c index 0d7d2b9e7249d..1101b542a5d8a 100644 --- a/ext/dom/html5_parser.c +++ b/ext/dom/html5_parser.c @@ -30,6 +30,8 @@ #include #include +typedef struct php_dom_ns_magic_token php_dom_ns_magic_token; + #define WORK_LIST_INIT_SIZE 128 /* libxml2 reserves 2 pointer-sized words for interned strings */ #define LXML_INTERNED_STRINGS_SIZE (sizeof(void *) * 2) diff --git a/ext/dom/html5_parser.h b/ext/dom/html5_parser.h index a56166639a602..d2c937cd874f7 100644 --- a/ext/dom/html5_parser.h +++ b/ext/dom/html5_parser.h @@ -66,12 +66,15 @@ void lexbor_libxml2_bridge_parse_set_error_callbacks( lexbor_libxml2_bridge_tokenizer_error_reporter tokenizer_error_reporter, lexbor_libxml2_bridge_tree_error_reporter tree_error_reporter ); + +struct php_dom_private_data; + lexbor_libxml2_bridge_status lexbor_libxml2_bridge_convert_document( lxb_html_document_t *document, xmlDocPtr *doc_out, bool compact_text_nodes, bool create_default_ns, - php_dom_private_data *private_data + struct php_dom_private_data *private_data ); lexbor_libxml2_bridge_status lexbor_libxml2_bridge_convert_fragment( lxb_dom_node_t *start_node, @@ -79,7 +82,7 @@ lexbor_libxml2_bridge_status lexbor_libxml2_bridge_convert_fragment( xmlNodePtr *fragment_out, bool compact_text_nodes, bool create_default_ns, - php_dom_private_data *private_data + struct php_dom_private_data *private_data ); void lexbor_libxml2_bridge_report_errors( const lexbor_libxml2_bridge_parse_context *ctx, diff --git a/ext/dom/namespace_compat.c b/ext/dom/namespace_compat.c index 7a3bd68b0111a..4116639c6b272 100644 --- a/ext/dom/namespace_compat.c +++ b/ext/dom/namespace_compat.c @@ -25,6 +25,8 @@ #include "private_data.h" #include "internal_helpers.h" +typedef struct php_dom_ns_magic_token php_dom_ns_magic_token; + /* The actual value of these doesn't matter as long as they serve as a unique ID. * They need to be pointers because the `_private` field is a pointer, however we can choose the contents ourselves. * We need keep these at least 4-byte aligned because the pointer may be tagged (although for now 2 byte alignment works too). diff --git a/ext/dom/namespace_compat.h b/ext/dom/namespace_compat.h index 23c80acc7fd78..3cb4ac3f489b3 100644 --- a/ext/dom/namespace_compat.h +++ b/ext/dom/namespace_compat.h @@ -28,35 +28,32 @@ #define DOM_XMLNS_NS_URI "http://www.w3.org/2000/xmlns/" struct php_dom_ns_magic_token; -typedef struct php_dom_ns_magic_token php_dom_ns_magic_token; - struct php_dom_libxml_ns_mapper; -typedef struct php_dom_libxml_ns_mapper php_dom_libxml_ns_mapper; -PHP_DOM_EXPORT extern const php_dom_ns_magic_token *php_dom_ns_is_html_magic_token; -PHP_DOM_EXPORT extern const php_dom_ns_magic_token *php_dom_ns_is_mathml_magic_token; -PHP_DOM_EXPORT extern const php_dom_ns_magic_token *php_dom_ns_is_svg_magic_token; -PHP_DOM_EXPORT extern const php_dom_ns_magic_token *php_dom_ns_is_xlink_magic_token; -PHP_DOM_EXPORT extern const php_dom_ns_magic_token *php_dom_ns_is_xml_magic_token; -PHP_DOM_EXPORT extern const php_dom_ns_magic_token *php_dom_ns_is_xmlns_magic_token; +PHP_DOM_EXPORT extern const struct php_dom_ns_magic_token *php_dom_ns_is_html_magic_token; +PHP_DOM_EXPORT extern const struct php_dom_ns_magic_token *php_dom_ns_is_mathml_magic_token; +PHP_DOM_EXPORT extern const struct php_dom_ns_magic_token *php_dom_ns_is_svg_magic_token; +PHP_DOM_EXPORT extern const struct php_dom_ns_magic_token *php_dom_ns_is_xlink_magic_token; +PHP_DOM_EXPORT extern const struct php_dom_ns_magic_token *php_dom_ns_is_xml_magic_token; +PHP_DOM_EXPORT extern const struct php_dom_ns_magic_token *php_dom_ns_is_xmlns_magic_token; /* These functions make it possible to make a namespace declaration also visible as an attribute by * creating an equivalent attribute node. */ -PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_ensure_html_ns(php_dom_libxml_ns_mapper *mapper); -PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_ensure_prefixless_xmlns_ns(php_dom_libxml_ns_mapper *mapper); -PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_get_ns(php_dom_libxml_ns_mapper *mapper, zend_string *prefix, zend_string *uri); -PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_get_ns_raw_prefix_string(php_dom_libxml_ns_mapper *mapper, const xmlChar *prefix, size_t prefix_len, zend_string *uri); -PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_get_ns_raw_strings_nullsafe(php_dom_libxml_ns_mapper *mapper, const char *prefix, const char *uri); +PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_ensure_html_ns(struct php_dom_libxml_ns_mapper *mapper); +PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_ensure_prefixless_xmlns_ns(struct php_dom_libxml_ns_mapper *mapper); +PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_get_ns(struct php_dom_libxml_ns_mapper *mapper, zend_string *prefix, zend_string *uri); +PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_get_ns_raw_prefix_string(struct php_dom_libxml_ns_mapper *mapper, const xmlChar *prefix, size_t prefix_len, zend_string *uri); +PHP_DOM_EXPORT xmlNsPtr php_dom_libxml_ns_mapper_get_ns_raw_strings_nullsafe(struct php_dom_libxml_ns_mapper *mapper, const char *prefix, const char *uri); -PHP_DOM_EXPORT php_dom_libxml_ns_mapper *php_dom_get_ns_mapper(dom_object *object); -PHP_DOM_EXPORT void php_dom_ns_compat_mark_attribute_list(php_dom_libxml_ns_mapper *mapper, xmlNodePtr node); -PHP_DOM_EXPORT void php_dom_libxml_reconcile_modern(php_dom_libxml_ns_mapper *ns_mapper, xmlNodePtr node); +PHP_DOM_EXPORT struct php_dom_libxml_ns_mapper *php_dom_get_ns_mapper(dom_object *object); +PHP_DOM_EXPORT void php_dom_ns_compat_mark_attribute_list(struct php_dom_libxml_ns_mapper *mapper, xmlNodePtr node); +PHP_DOM_EXPORT void php_dom_libxml_reconcile_modern(struct php_dom_libxml_ns_mapper *ns_mapper, xmlNodePtr node); PHP_DOM_EXPORT void php_dom_reconcile_attribute_namespace_after_insertion(xmlAttrPtr attrp); -PHP_DOM_EXPORT xmlAttrPtr php_dom_ns_compat_mark_attribute(php_dom_libxml_ns_mapper *mapper, xmlNodePtr node, xmlNsPtr ns); +PHP_DOM_EXPORT xmlAttrPtr php_dom_ns_compat_mark_attribute(struct php_dom_libxml_ns_mapper *mapper, xmlNodePtr node, xmlNsPtr ns); -PHP_DOM_EXPORT bool php_dom_ns_is_fast(const xmlNode *nodep, const php_dom_ns_magic_token *magic_token); -PHP_DOM_EXPORT bool php_dom_ns_is_fast_ex(xmlNsPtr ns, const php_dom_ns_magic_token *magic_token); +PHP_DOM_EXPORT bool php_dom_ns_is_fast(const xmlNode *nodep, const struct php_dom_ns_magic_token *magic_token); +PHP_DOM_EXPORT bool php_dom_ns_is_fast_ex(xmlNsPtr ns, const struct php_dom_ns_magic_token *magic_token); PHP_DOM_EXPORT bool php_dom_ns_is_html_and_document_is_html(const xmlNode *nodep); typedef struct php_dom_in_scope_ns { @@ -65,7 +62,7 @@ typedef struct php_dom_in_scope_ns { bool origin_is_ns_compat; } php_dom_in_scope_ns; -PHP_DOM_EXPORT php_dom_in_scope_ns php_dom_get_in_scope_ns(php_dom_libxml_ns_mapper *ns_mapper, const xmlNode *node, bool ignore_elements); +PHP_DOM_EXPORT php_dom_in_scope_ns php_dom_get_in_scope_ns(struct php_dom_libxml_ns_mapper *ns_mapper, const xmlNode *node, bool ignore_elements); PHP_DOM_EXPORT php_dom_in_scope_ns php_dom_get_in_scope_ns_legacy(const xmlNode *node); PHP_DOM_EXPORT void php_dom_in_scope_ns_destroy(php_dom_in_scope_ns *in_scope_ns); diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 0f19a05501a64..6dd3203a0ad0f 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -115,7 +115,6 @@ typedef enum dom_iterator_type { } dom_iterator_type; struct php_dom_libxml_ns_mapper; -typedef struct php_dom_libxml_ns_mapper php_dom_libxml_ns_mapper; static inline dom_object_namespace_node *php_dom_namespace_node_obj_from_obj(zend_object *obj) { return (dom_object_namespace_node*)((char*)(obj) - XtOffsetOf(dom_object_namespace_node, dom.std)); @@ -176,7 +175,7 @@ xmlDocPtr php_dom_create_html_doc(void); xmlEntityPtr dom_entity_reference_fetch_and_sync_declaration(xmlNodePtr reference); void dom_set_xml_class(php_libxml_ref_obj *document); const char *dom_locate_a_namespace(const xmlNode *node, const zend_string *prefix); -void dom_mark_namespaces_as_attributes_too(php_dom_libxml_ns_mapper *ns_mapper, xmlDocPtr doc); +void dom_mark_namespaces_as_attributes_too(struct php_dom_libxml_ns_mapper *ns_mapper, xmlDocPtr doc); bool dom_compare_value(const xmlAttr *attr, const xmlChar *value); void dom_attr_value_will_change(dom_object *obj, xmlAttrPtr attrp); bool php_dom_create_nullable_object(xmlNodePtr obj, zval *return_value, dom_object *domobj); @@ -216,7 +215,7 @@ xmlNodePtr php_dom_named_node_map_get_item(dom_nnodemap_object *objmap, zend_lon void php_dom_named_node_map_get_item_into_zval(dom_nnodemap_object *objmap, zend_long index, zval *return_value); int php_dom_get_namednodemap_length(dom_object *obj); -xmlNodePtr dom_clone_node(php_dom_libxml_ns_mapper *ns_mapper, xmlNodePtr node, xmlDocPtr doc, bool recursive); +xmlNodePtr dom_clone_node(struct php_dom_libxml_ns_mapper *ns_mapper, xmlNodePtr node, xmlDocPtr doc, bool recursive); #define DOM_GET_INTERN(__id, __intern) { \ __intern = Z_DOMOBJ_P(__id); \ diff --git a/ext/dom/private_data.h b/ext/dom/private_data.h index ead6c75caf249..50d175081c321 100644 --- a/ext/dom/private_data.h +++ b/ext/dom/private_data.h @@ -19,30 +19,23 @@ #include "xml_common.h" -struct php_dom_libxml_ns_mapper { +struct php_libxml_private_data_header; + +typedef struct php_dom_libxml_ns_mapper { /* This is used almost all the time for HTML documents, so it makes sense to cache this. */ xmlNsPtr html_ns; /* Used for every prefixless namespace declaration in XML, so also very common. */ xmlNsPtr prefixless_xmlns_ns; HashTable uri_to_prefix_map; -}; +} php_dom_libxml_ns_mapper; typedef struct php_dom_private_data { - php_libxml_private_data_header header; + struct php_libxml_private_data_header header; struct php_dom_libxml_ns_mapper ns_mapper; HashTable *template_fragments; } php_dom_private_data; -typedef struct php_libxml_private_data_header php_libxml_private_data_header; -struct php_libxml_private_data_header; - -struct php_dom_private_data; -typedef struct php_dom_private_data php_dom_private_data; - -struct php_dom_libxml_ns_mapper; -typedef struct php_dom_libxml_ns_mapper php_dom_libxml_ns_mapper; - -php_libxml_private_data_header *php_dom_libxml_private_data_header(php_dom_private_data *private_data); +struct php_libxml_private_data_header *php_dom_libxml_private_data_header(php_dom_private_data *private_data); php_dom_libxml_ns_mapper *php_dom_ns_mapper_from_private(php_dom_private_data *private_data); php_dom_private_data *php_dom_private_data_create(void); void php_dom_private_data_destroy(php_dom_private_data *data); diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h index 8e5734d5a914e..cf8fe3be393bd 100644 --- a/ext/dom/xml_common.h +++ b/ext/dom/xml_common.h @@ -81,12 +81,11 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj); DOM_GET_OBJ(__ptr, __id, __prtype, __intern); struct php_dom_private_data; -typedef struct php_dom_private_data php_dom_private_data; -static zend_always_inline php_dom_private_data *php_dom_get_private_data(dom_object *intern) +static zend_always_inline struct php_dom_private_data *php_dom_get_private_data(dom_object *intern) { ZEND_ASSERT(intern->document != NULL); - return (php_dom_private_data *) intern->document->private_data; + return (struct php_dom_private_data *) intern->document->private_data; } static zend_always_inline xmlNodePtr php_dom_next_in_tree_order(const xmlNode *nodep, const xmlNode *basep) diff --git a/ext/dom/xml_serializer.h b/ext/dom/xml_serializer.h index 2d5c3bd84277b..60b1d0ea97fc9 100644 --- a/ext/dom/xml_serializer.h +++ b/ext/dom/xml_serializer.h @@ -23,8 +23,7 @@ #include struct php_dom_private_data; -typedef struct php_dom_private_data php_dom_private_data; -int dom_xml_serialize(xmlSaveCtxtPtr ctx, xmlOutputBufferPtr out, xmlNodePtr node, bool format, bool require_well_formed, php_dom_private_data *private_data); +int dom_xml_serialize(xmlSaveCtxtPtr ctx, xmlOutputBufferPtr out, xmlNodePtr node, bool format, bool require_well_formed, struct php_dom_private_data *private_data); #endif diff --git a/ext/opcache/jit/ir/ir.h b/ext/opcache/jit/ir/ir.h index cf7580dc7496a..f7ed46f114cd9 100644 --- a/ext/opcache/jit/ir/ir.h +++ b/ext/opcache/jit/ir/ir.h @@ -477,7 +477,7 @@ typedef struct _ir_insn { } ir_insn; /* IR Hash Tables API (private) */ -typedef struct _ir_hashtab ir_hashtab; +struct _ir_hashtab; /* IR String Tables API (implementation in ir_strtab.c) */ typedef struct _ir_strtab { @@ -580,7 +580,7 @@ struct _ir_ctx { int32_t status; /* non-zero error code (see IR_ERROR_... macros), app may use negative codes */ ir_ref fold_cse_limit; /* CSE finds identical insns backward from "insn_count" to "fold_cse_limit" */ ir_insn fold_insn; /* temporary storage for folding engine */ - ir_hashtab *binding; + struct _ir_hashtab *binding; ir_use_list *use_lists; /* def->use lists for each instruction */ ir_ref *use_edges; /* the actual uses: use = ctx->use_edges[ctx->use_lists[def].refs + n] */ ir_ref use_edges_count; /* number of elements in use_edges[] array */ diff --git a/ext/opcache/jit/ir/ir_x86.dasc b/ext/opcache/jit/ir/ir_x86.dasc index 1fa7001198c94..aaf0f9ddd45a2 100644 --- a/ext/opcache/jit/ir/ir_x86.dasc +++ b/ext/opcache/jit/ir/ir_x86.dasc @@ -10852,7 +10852,7 @@ next_block:; do { /* _cldemote(p); */ - asm volatile(".byte 0x0f, 0x1c, 0x06" :: "S" (p)); + __asm__ volatile(".byte 0x0f, 0x1c, 0x06" :: "S" (p)); p += 64; } while (p < start + size); } diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 80099291d886d..9f86cf61ffb3b 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -3279,7 +3279,7 @@ static void zend_jit_setup(void) !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__MUSL__) size_t ret; - asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0" + __asm__ ("movq _tsrm_ls_cache@gottpoff(%%rip),%0" : "=r" (ret)); tsrm_ls_cache_tcb_offset = ret; #elif defined(__MUSL__) @@ -3315,7 +3315,7 @@ static void zend_jit_setup(void) #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__MUSL__) size_t ret; - asm ("leal _tsrm_ls_cache@ntpoff,%0\n" + __asm__ ("leal _tsrm_ls_cache@ntpoff,%0\n" : "=a" (ret)); tsrm_ls_cache_tcb_offset = ret; #else diff --git a/ext/random/php_random.h b/ext/random/php_random.h index e4aa32126671e..1ed741c5c8f44 100644 --- a/ext/random/php_random.h +++ b/ext/random/php_random.h @@ -37,10 +37,10 @@ PHPAPI double php_combined_lcg(void); -typedef struct _php_random_fallback_seed_state php_random_fallback_seed_state; +struct _php_random_fallback_seed_state; PHPAPI uint64_t php_random_generate_fallback_seed(void); -PHPAPI uint64_t php_random_generate_fallback_seed_ex(php_random_fallback_seed_state *state); +PHPAPI uint64_t php_random_generate_fallback_seed_ex(struct _php_random_fallback_seed_state *state); static inline zend_long GENERATE_SEED(void) { diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index eaefdb2f8ef7c..e6c49d8521f2e 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -25,6 +25,7 @@ #include "ext/libxml/php_libxml.h" #include "ext/dom/namespace_compat.h" +typedef struct php_dom_libxml_ns_mapper php_dom_libxml_ns_mapper; static zend_result php_xsl_xslt_apply_params(xsltTransformContextPtr ctxt, HashTable *params) { diff --git a/main/debug_gdb_scripts.c b/main/debug_gdb_scripts.c index ad03a2c2ba62f..98e57627e2b2b 100644 --- a/main/debug_gdb_scripts.c +++ b/main/debug_gdb_scripts.c @@ -6,7 +6,7 @@ * * See https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section */ -asm( +__asm__( ".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n" ".byte 4 /* Python Text */\n" ".ascii \"gdb.inlined-script\\n\"\n" diff --git a/scripts/gdb/debug_gdb_scripts_gen.php b/scripts/gdb/debug_gdb_scripts_gen.php index 1b33d9a63aa6e..2667f249fe4bb 100755 --- a/scripts/gdb/debug_gdb_scripts_gen.php +++ b/scripts/gdb/debug_gdb_scripts_gen.php @@ -27,7 +27,7 @@ * * See https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section */ - asm( + __asm__( ".pushsection \".debug_gdb_scripts\", \"MS\",%%progbits,1\n" ".byte 4 /* Python Text */\n" ".ascii \"gdb.inlined-script\\n\"\n"