cvs: ZendEngine2 / zend.h zend_alloc.c zend_builtin_functions.c zend_compile.c zend_execute.c

From: Date: Thu, 28 Aug 2003 16:41:20 +0000
Subject: cvs: ZendEngine2 / zend.h zend_alloc.c zend_builtin_functions.c zend_compile.c zend_execute.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1721@lists.php.net to get a copy of this message
sas Thu Aug 28 12:41:20 2003 EDT Modified files: /ZendEngine2 zend.h zend_alloc.c zend_builtin_functions.c zend_compile.c zend_execute.c Log: Add format attribute to a number of functions Kill a few warnings

Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.220 ZendEngine2/zend.h:1.221 --- ZendEngine2/zend.h:1.220 Thu Aug 28 10:53:02 2003 +++ ZendEngine2/zend.h Thu Aug 28 12:41:19 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.220 2003/08/28 14:53:02 sas Exp $ */ +/* $Id: zend.h,v 1.221 2003/08/28 16:41:19 sas Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -158,6 +158,12 @@ # define ZEND_ATTRIBUTE_MALLOC #endif +#if ZEND_GCC_VERSION >= 2007 +# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first))) +#else +# define ZEND_ATTRIBUTE_FORMAT(type, idx, first) +#endif + #if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) # define do_alloca(p) alloca(p) # define free_alloca(p) @@ -341,8 +347,8 @@ #include "zend_stream.h" typedef struct _zend_utility_functions { - void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); - int (*printf_function)(const char *format, ...); + void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_FORMAT(printf, 4, 0); + int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); int (*write_function)(const char *str, uint str_length); FILE *(*fopen_function)(const char *filename, char **opened_path); void (*message_handler)(long message, void *data); @@ -442,7 +448,7 @@ ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC); ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC); ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC); -ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...); +ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); void zend_activate(TSRMLS_D); void zend_deactivate(TSRMLS_D); @@ -479,18 +485,18 @@ BEGIN_EXTERN_C() -extern ZEND_API int (*zend_printf)(const char *format, ...); +extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); extern ZEND_API zend_write_func_t zend_write; extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); extern ZEND_API void (*zend_block_interruptions)(void); extern ZEND_API void (*zend_unblock_interruptions)(void); extern ZEND_API void (*zend_ticks_function)(int ticks); -extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); +extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_FORMAT(printf, 4, 0); extern void (*zend_on_timeout)(int seconds TSRMLS_DC); extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); -ZEND_API void zend_error(int type, const char *format, ...); +ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); void zenderror(char *error); Index: ZendEngine2/zend_alloc.c diff -u ZendEngine2/zend_alloc.c:1.123 ZendEngine2/zend_alloc.c:1.124 --- ZendEngine2/zend_alloc.c:1.123 Wed Aug 20 19:27:04 2003 +++ ZendEngine2/zend_alloc.c Thu Aug 28 12:41:19 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_alloc.c,v 1.123 2003/08/20 23:27:04 zeev Exp $ */ +/* $Id: zend_alloc.c,v 1.124 2003/08/28 16:41:19 sas Exp $ */ #include "zend.h" #include "zend_alloc.h" @@ -470,8 +470,12 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC) { +#if ZEND_DEBUG || !defined(ZEND_MM) zend_mem_header *p, *t; +#endif +#if ZEND_DEBUG zend_uint grand_total_leaks=0; +#endif #if defined(ZEND_MM) && !ZEND_DEBUG if (clean_cache) { Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.206 ZendEngine2/zend_builtin_functions.c:1.207 --- ZendEngine2/zend_builtin_functions.c:1.206 Fri Aug 22 14:50:12 2003 +++ ZendEngine2/zend_builtin_functions.c Thu Aug 28 12:41:19 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.206 2003/08/22 18:50:12 iliaa Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.207 2003/08/28 16:41:19 sas Exp $ */ #include "zend.h" #include "zend_API.h" @@ -245,7 +245,7 @@ arg_count = (ulong) *p; if (requested_offset>=arg_count) { - zend_error(E_WARNING, "func_get_arg(): Argument %d not passed to function", requested_offset); + zend_error(E_WARNING, "func_get_arg(): Argument %ld not passed to function", requested_offset); RETURN_FALSE; } @@ -1461,6 +1461,7 @@ lineno = ptr->opline->lineno; } else { filename = NULL; + lineno = 0; } function_name = ptr->function_state.function->common.function_name; @@ -1516,6 +1517,7 @@ array_init(arg_array); add_next_index_string(arg_array, include_filename, 1); } + call_type = NULL; } zend_printf("#%-2d ", indent); if (class_name) { Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.467 ZendEngine2/zend_compile.c:1.468 --- ZendEngine2/zend_compile.c:1.467 Sun Aug 24 13:32:47 2003 +++ ZendEngine2/zend_compile.c Thu Aug 28 12:41:19 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.467 2003/08/24 17:32:47 helly Exp $ */ +/* $Id: zend_compile.c,v 1.468 2003/08/28 16:41:19 sas Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -1352,8 +1352,7 @@ "If you would like to enable call-time pass-by-reference, you can set " "allow_call_time_pass_reference to true in your INI file. " "However, future versions may not support this any longer. ", - (function_ptr?function_ptr->common.function_name:"[runtime function name]"), - offset+1); + (function_ptr?function_ptr->common.function_name:"[runtime function name]")); } if (function_ptr) { Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.529 ZendEngine2/zend_execute.c:1.530 --- ZendEngine2/zend_execute.c:1.529 Sun Aug 24 11:59:19 2003 +++ ZendEngine2/zend_execute.c Thu Aug 28 12:41:20 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.529 2003/08/24 15:59:19 zeev Exp $ */ +/* $Id: zend_execute.c,v 1.530 2003/08/28 16:41:20 sas Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -789,13 +789,13 @@ if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) { switch (type) { case BP_VAR_R: - zend_error(E_NOTICE,"Undefined offset: %d", index); + zend_error(E_NOTICE,"Undefined offset: %ld", index); /* break missing intentionally */ case BP_VAR_IS: retval = &EG(uninitialized_zval_ptr); break; case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined offset: %d", index); + zend_error(E_NOTICE,"Undefined offset: %ld", index); /* break missing intentionally */ case BP_VAR_W: { zval *new_zval = &EG(uninitialized_zval); @@ -2901,7 +2901,7 @@ if (zend_ptr_stack_get_arg(arg_num, (void **) &param TSRMLS_CC)==FAILURE) { zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - zend_error(E_WARNING, "Missing argument %d for %s()\n", EX(opline)->op1.u.constant.value.lval, get_active_function_name(TSRMLS_C)); + zend_error(E_WARNING, "Missing argument %ld for %s()\n", EX(opline)->op1.u.constant.value.lval, get_active_function_name(TSRMLS_C)); if (EX(opline)->result.op_type == IS_VAR) { PZVAL_UNLOCK(*EX_T(EX(opline)->result.u.var).var.ptr_ptr); }
« previous php.zend-engine.cvs (#1721) next »