]> granicus.if.org Git - php/commitdiff
Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
authorDmitry Stogov <dmitry@zend.com>
Tue, 21 Jun 2016 13:00:37 +0000 (16:00 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 21 Jun 2016 13:00:37 +0000 (16:00 +0300)
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.

92 files changed:
Zend/zend.h
Zend/zend_API.c
Zend/zend_alloc.c
Zend/zend_compile.c
Zend/zend_exceptions.c
Zend/zend_exceptions.h
Zend/zend_execute.c
Zend/zend_execute_API.c
Zend/zend_hash.c
Zend/zend_long.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/bz2/bz2_filter.c
ext/calendar/calendar.c
ext/fileinfo/fileinfo.c
ext/ftp/php_ftp.c
ext/gd/gd.c
ext/gmp/gmp.c
ext/imap/php_imap.c
ext/interbase/ibase_service.c
ext/interbase/php_ibase_includes.h
ext/intl/converter/converter.c
ext/intl/dateformat/dateformat_format.c
ext/intl/formatter/formatter_format.c
ext/intl/formatter/formatter_parse.c
ext/ldap/ldap.c
ext/mbstring/mb_gpc.c
ext/mysqli/mysqli_api.c
ext/mysqli/mysqli_nonapi.c
ext/oci8/oci8.c
ext/oci8/oci8_lob.c
ext/oci8/oci8_statement.c
ext/opcache/ZendAccelerator.c
ext/opcache/zend_accelerator_debug.h
ext/opcache/zend_accelerator_module.c
ext/opcache/zend_shared_alloc.c
ext/openssl/openssl.c
ext/pdo/pdo.c
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c
ext/pdo_pgsql/pgsql_driver.c
ext/pdo_pgsql/pgsql_statement.c
ext/pgsql/pgsql.c
ext/phar/func_interceptors.c
ext/phar/phar_object.c
ext/pspell/pspell.c
ext/session/php_session.h
ext/simplexml/simplexml.c
ext/snmp/snmp.c
ext/soap/php_encoding.c
ext/soap/php_http.c
ext/soap/soap.c
ext/sockets/conversions.c
ext/sockets/multicast.c
ext/sockets/sendrecvmsg.c
ext/sockets/sockets.c
ext/spl/php_spl.c
ext/spl/spl_array.c
ext/spl/spl_directory.c
ext/spl/spl_dllist.c
ext/spl/spl_iterators.c
ext/spl/spl_observer.c
ext/standard/array.c
ext/standard/assert.c
ext/standard/dir.c
ext/standard/file.c
ext/standard/formatted_print.c
ext/standard/ftp_fopen_wrapper.c
ext/standard/http.c
ext/standard/http_fopen_wrapper.c
ext/standard/math.c
ext/standard/proc_open.c
ext/standard/streamsfuncs.c
ext/standard/var.c
ext/standard/var_unserializer.c
ext/standard/var_unserializer.re
ext/sysvmsg/sysvmsg.c
ext/sysvsem/sysvsem.c
ext/sysvshm/sysvshm.c
ext/xmlrpc/xmlrpc-epi-php.c
ext/zip/php_zip.c
ext/zlib/zlib.c
ext/zlib/zlib_filter.c
main/SAPI.c
main/SAPI.h
main/fastcgi.h
main/main.c
main/rfc1867.c
main/snprintf.h
main/streams/xp_socket.c
sapi/cli/php_cli_server.c
sapi/fpm/fpm/fpm_log.c

index 1e0a5613e6d3da12a6a7ba8eea1f408ebd8db051..f473e2cc215f01a2caf041fcde5dd1c4768c2c03 100644 (file)
@@ -71,9 +71,9 @@ ZEND_TSRMLS_CACHE_EXTERN()
 
 #ifdef HAVE_NORETURN
 # ifdef ZEND_NORETURN_ALIAS
-ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
+ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 # else
-ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
+ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 # endif
 #else
 # define zend_error_noreturn zend_error
@@ -267,9 +267,9 @@ extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
 extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);
 
 ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
-ZEND_API ZEND_COLD void zend_type_error(const char *format, ...);
-ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
+ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
+ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 
 ZEND_COLD void zenderror(const char *error);
 
index 18d83829340789a1a0780c9c685b82e4cc33de06..0de75c005c3faca5163a899bbf589726e38dc27c 100644 (file)
@@ -3846,7 +3846,7 @@ ZEND_API void zend_update_property_ex(zend_class_entry *scope, zval *object, zen
        EG(fake_scope) = scope;
 
        if (!Z_OBJ_HT_P(object)->write_property) {
-               zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
+               zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name));
        }
        ZVAL_STR(&property, name);
        Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL);
@@ -4041,7 +4041,7 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend
        EG(fake_scope) = scope;
 
        if (!Z_OBJ_HT_P(object)->read_property) {
-               zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
+               zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name));
        }
 
        ZVAL_STR(&property, name);
index a7e3808e7cab0e0122a94436dbb6dac6d91b29c6..76664c01ce05212c9aa626adfa24209dd309f5c0 100644 (file)
@@ -193,14 +193,6 @@ typedef struct  _zend_mm_free_slot zend_mm_free_slot;
 typedef struct  _zend_mm_chunk     zend_mm_chunk;
 typedef struct  _zend_mm_huge_list zend_mm_huge_list;
 
-#ifdef _WIN64
-# define PTR_FMT "0x%0.16I64x"
-#elif SIZEOF_LONG == 8
-# define PTR_FMT "0x%0.16lx"
-#else
-# define PTR_FMT "0x%0.8lx"
-#endif
-
 #ifdef MAP_HUGETLB
 int zend_mm_use_huge_pages = 0;
 #endif
@@ -2515,7 +2507,7 @@ ZEND_API char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_
 
        length = strlen(s);
        if (UNEXPECTED(length + 1 == 0)) {
-               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", 1, length, 1);
+               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (1 * %zu + 1)", length);
        }
        p = (char *) _emalloc(length + 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
        if (UNEXPECTED(p == NULL)) {
@@ -2530,7 +2522,7 @@ ZEND_API char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LI
        char *p;
 
        if (UNEXPECTED(length + 1 == 0)) {
-               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", 1, length, 1);
+               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (1 * %zu + 1)", length);
        }
        p = (char *) _emalloc(length + 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
        if (UNEXPECTED(p == NULL)) {
@@ -2547,7 +2539,7 @@ ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length)
        char *p;
 
        if (UNEXPECTED(length + 1 == 0)) {
-               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", 1, length, 1);
+               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (1 * %zu + 1)", length);
        }
        p = (char *) malloc(length + 1);
        if (UNEXPECTED(p == NULL)) {
index 1d544c6561ead4732d48314250be878cef460060..7780066b27876cda6014a5f50d06a99db3dc0324 100644 (file)
@@ -1151,7 +1151,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
                         * so we shut up about it.  This allows the if (!defined('FOO')) { return; }
                         * approach to work.
                         */
-                       zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare  %s, because the name is already in use", zend_get_object_type(Z_OBJCE_P(lcname)), Z_STRVAL_P(lcname));
+                       zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare  %s, because the name is already in use", zend_get_object_type(Z_OBJCE_P(lcname)));
                }
                return NULL;
        }
index 4a85e4e73aac16484aaa8a605194f8a2b8ff0ee5..047c115472ae80d87353956c759b728a56a8612c 100644 (file)
@@ -617,7 +617,7 @@ ZEND_METHOD(exception, getTraceAsString)
        }
        ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(trace), index, frame) {
                if (Z_TYPE_P(frame) != IS_ARRAY) {
-                       zend_error(E_WARNING, "Expected array for frame %pu", index);
+                       zend_error(E_WARNING, "Expected array for frame " ZEND_ULONG_FMT, index);
                        continue;
                }
 
index d351c2468d6030d541f42e43cc65a73f24139768..04857f29fab113f4645b9cc984672c7aa6a3fc77 100644 (file)
@@ -56,7 +56,7 @@ ZEND_API void zend_register_default_classes(void);
 /* exception_ce   NULL, zend_ce_exception, zend_ce_error, or a derived class
  * message        NULL or the message of the exception */
 ZEND_API ZEND_COLD zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
-ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...);
+ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
 ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception);
 ZEND_API void zend_clear_exception(void);
 
@@ -68,8 +68,8 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex);
 ZEND_API ZEND_COLD void zend_exception_error(zend_object *exception, int severity);
 
 /* do not export, in php it's available thru spprintf directly */
-size_t zend_spprintf(char **message, size_t max_len, const char *format, ...);
-zend_string *zend_strpprintf(size_t max_len, const char *format, ...);
+size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
+zend_string *zend_strpprintf(size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 
 END_EXTERN_C()
 
index a41c9dd59432f61168c5c839fbcf2c30b871be03..c8d2f7c51318fdf234bbe7d14dc087292f2bfb50 100644 (file)
@@ -1607,7 +1607,7 @@ str_index:
                                hval = zend_dval_to_lval(Z_DVAL_P(dim));
                                goto num_index;
                        case IS_RESOURCE:
-                               zend_error(E_NOTICE, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
+                               zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
                                hval = Z_RES_HANDLE_P(dim);
                                goto num_index;
                        case IS_FALSE:
@@ -1833,7 +1833,7 @@ try_string_offset:
 
                if (UNEXPECTED(Z_STRLEN_P(container) < (size_t)((offset < 0) ? -offset : (offset + 1)))) {
                        if (type != BP_VAR_IS) {
-                               zend_error(E_NOTICE, "Uninitialized string offset: %pd", offset);
+                               zend_error(E_NOTICE, "Uninitialized string offset: " ZEND_LONG_FMT, offset);
                                ZVAL_EMPTY_STRING(result);
                        } else {
                                ZVAL_NULL(result);
index f7bce4f4e5b988d5b24629516c98cfc805a43be6..d292de19e49e0869b3b5018f44576a7da6048079 100644 (file)
@@ -1175,7 +1175,7 @@ ZEND_API ZEND_NORETURN void zend_timeout(int dummy) /* {{{ */
        zend_set_timeout_ex(0, 1);
 #endif
 
-       zend_error_noreturn(E_ERROR, "Maximum execution time of %pd second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
+       zend_error_noreturn(E_ERROR, "Maximum execution time of " ZEND_LONG_FMT " second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
 }
 /* }}} */
 
@@ -1205,7 +1205,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */
                        error_filename = "Unknown";
                }
 
-               zend_spprintf(&log_buffer, 0, "\nFatal error: Maximum execution time of %pd+%pd seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
+               zend_spprintf(&log_buffer, 0, "\nFatal error: Maximum execution time of " ZEND_LONG_FMT "+" ZEND_LONG_FMT " seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
                write(2, log_buffer, strlen(log_buffer));
                _exit(1);
     }
index 47215d3511ae9f7a68ae2174150ab1569da2e470..b59d5885a6de6f6f80e427502bbd3cf5d2f4191f 100644 (file)
@@ -103,7 +103,7 @@ static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize)
        if (nSize < HT_MIN_SIZE) {
                nSize = HT_MIN_SIZE;
        } else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) {
-               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
+               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
        }
 
 #if defined(ZEND_WIN32)
@@ -189,7 +189,7 @@ static void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht)
 {
        HT_ASSERT(GC_REFCOUNT(ht) == 1);
        if (ht->nTableSize >= HT_MAX_SIZE) {
-               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket));
+               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket));
        }
        ht->nTableSize += ht->nTableSize;
        HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE(ht), HT_USED_SIZE(ht), ht->u.flags & HASH_FLAG_PERSISTENT));
@@ -869,7 +869,7 @@ static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht)
                pefree(old_data, ht->u.flags & HASH_FLAG_PERSISTENT);
                zend_hash_rehash(ht);
        } else {
-               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket));
+               zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket));
        }
 }
 
index 60d1c71d3c424359bac1691a15b60dc7d4198288..e6713da87188264b69e13856b4802492f1d32c79 100644 (file)
@@ -59,6 +59,7 @@ typedef int32_t zend_off_t;
 #ifdef ZEND_ENABLE_ZVAL_LONG64
 # define ZEND_LONG_FMT "%" PRId64
 # define ZEND_ULONG_FMT "%" PRIu64
+# define ZEND_XLONG_FMT "%" PRIx64
 # define ZEND_LONG_FMT_SPEC PRId64
 # define ZEND_ULONG_FMT_SPEC PRIu64
 # ifdef ZEND_WIN32
@@ -87,6 +88,7 @@ typedef int32_t zend_off_t;
 # define ZEND_STRTOUL(s0, s1, base) strtoul((s0), (s1), (base))
 # define ZEND_LONG_FMT "%" PRId32
 # define ZEND_ULONG_FMT "%" PRIu32
+# define ZEND_XLONG_FMT "%" PRIx32
 # define ZEND_LONG_FMT_SPEC PRId32
 # define ZEND_ULONG_FMT_SPEC PRIu32
 # ifdef ZEND_WIN32
@@ -117,6 +119,16 @@ typedef int32_t zend_off_t;
 
 static const char long_min_digits[] = LONG_MIN_DIGITS;
 
+#ifdef _WIN64
+# define ZEND_ADDR_FMT "0x%016I64x"
+#elif SIZEOF_SIZE_T == 4
+# define ZEND_ADDR_FMT "0x%08zx"
+#elif SIZEOF_SIZE_T == 8
+# define ZEND_ADDR_FMT "0x%016zx"
+#else
+# error "Unknown SIZEOF_SIZE_T"
+#endif
+
 #endif /* ZEND_LONG_H */
 
 /*
index 4742a62b5860896089ef537f93767d39aca7ab82..c8e9eb12a5040996ed98a254bfcd6dc0157817c1 100644 (file)
@@ -7548,7 +7548,7 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
                        ZVAL_OBJ(&generator->values, &iter->std);
                }
        } else {
-               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
                HANDLE_EXCEPTION();
        }
 
index b0da3c043d645b2d7c062e123dd54e6fddca267d..837cab2b564041ca19d99cb9a0a7a19244f3d6ac 100644 (file)
@@ -3925,7 +3925,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(
                        ZVAL_OBJ(&generator->values, &iter->std);
                }
        } else {
-               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
                HANDLE_EXCEPTION();
        }
 
@@ -13002,7 +13002,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE
                        ZVAL_OBJ(&generator->values, &iter->std);
                }
        } else {
-               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
                HANDLE_EXCEPTION();
        }
 
@@ -16949,7 +16949,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE
                        ZVAL_OBJ(&generator->values, &iter->std);
                }
        } else {
-               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
                HANDLE_EXCEPTION();
        }
 
@@ -35670,7 +35670,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN
                        ZVAL_OBJ(&generator->values, &iter->std);
                }
        } else {
-               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
+               zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
                HANDLE_EXCEPTION();
        }
 
index b076f9554e2c728ccb8e9d59427d45da71200e58..2211549fe8d5657602cf71ede5c6171f7a7e706d 100644 (file)
@@ -379,7 +379,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
                                        /* How much memory to allocate (1 - 9) x 100kb */
                                        zend_long blocks = zval_get_long(tmpzval);
                                        if (blocks < 1 || blocks > 9) {
-                                               php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", blocks);
+                                               php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (" ZEND_LONG_FMT ")", blocks);
                                        } else {
                                                blockSize100k = (int) blocks;
                                        }
@@ -389,7 +389,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
                                        /* Work Factor (0 - 250) */
                                        zend_long work = zval_get_long(tmpzval);
                                        if (work < 0 || work > 250) {
-                                               php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (%pd)", work);
+                                               php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (" ZEND_LONG_FMT ")", work);
                                        } else {
                                                workFactor = (int) work;
                                        }
index 78d772adcebd73065249cef7863060ead4a59077..ad2332c54090e56e8ce7f346c708399acb2540d9 100644 (file)
@@ -311,7 +311,7 @@ PHP_FUNCTION(cal_info)
 
 
        if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
-               php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
+               php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT ".", cal);
                RETURN_FALSE;
        }
 
@@ -333,7 +333,7 @@ PHP_FUNCTION(cal_days_in_month)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
+               php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT ".", cal);
                RETURN_FALSE;
        }
 
@@ -375,7 +375,7 @@ PHP_FUNCTION(cal_to_jd)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
+               php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT ".", cal);
                RETURN_FALSE;
        }
 
@@ -397,7 +397,7 @@ PHP_FUNCTION(cal_from_jd)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd", cal);
+               php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT "", cal);
                RETURN_FALSE;
        }
        calendar = &cal_conversion_table[cal];
index cc56e188fd54e3c99216854b3159576687e52d6b..147390099987f3ca579738d5d6d497447829f3cf 100644 (file)
@@ -173,7 +173,7 @@ zend_function_entry finfo_class_functions[] = {
 
 #define FINFO_SET_OPTION(magic, options) \
        if (magic_setflags(magic, options) == -1) { \
-               php_error_docref(NULL, E_WARNING, "Failed to set option '%pd' %d:%s", \
+               php_error_docref(NULL, E_WARNING, "Failed to set option '" ZEND_LONG_FMT "' %d:%s", \
                                options, magic_errno(magic), magic_error(magic)); \
                RETURN_FALSE; \
        }
@@ -340,7 +340,7 @@ PHP_FUNCTION(finfo_open)
 
        if (finfo->magic == NULL) {
                efree(finfo);
-               php_error_docref(NULL, E_WARNING, "Invalid mode '%pd'.", options);
+               php_error_docref(NULL, E_WARNING, "Invalid mode '" ZEND_LONG_FMT "'.", options);
                if (object) {
                        zend_restore_error_handling(&zeh);
                        if (!EG(exception)) {
index 5bbca446b2811de757b4df47394826ec87728e1e..8afd3e2b6d10de0fa4e83312586123047382f25f 100644 (file)
@@ -1491,7 +1491,7 @@ PHP_FUNCTION(ftp_set_option)
                        RETURN_TRUE;
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
+                       php_error_docref(NULL, E_WARNING, "Unknown option '" ZEND_LONG_FMT "'", option);
                        RETURN_FALSE;
                        break;
        }
@@ -1525,7 +1525,7 @@ PHP_FUNCTION(ftp_get_option)
                        RETURN_BOOL(ftp->usepasvaddress);
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
+                       php_error_docref(NULL, E_WARNING, "Unknown option '" ZEND_LONG_FMT "'", option);
                        RETURN_FALSE;
                        break;
        }
index b09990938d962345b5241b2c3450dd79c4c5facf..ff6dea69b3b892aece19efdd9f30f778f4393f16 100644 (file)
@@ -2809,14 +2809,14 @@ PHP_FUNCTION(imagecolorat)
                if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
                        RETURN_LONG(gdImageTrueColorPixel(im, x, y));
                } else {
-                       php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+                       php_error_docref(NULL, E_NOTICE, "" ZEND_LONG_FMT "," ZEND_LONG_FMT " is out of bounds", x, y);
                        RETURN_FALSE;
                }
        } else {
                if (im->pixels && gdImageBoundsSafe(im, x, y)) {
                        RETURN_LONG(im->pixels[y][x]);
                } else {
-                       php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+                       php_error_docref(NULL, E_NOTICE, "" ZEND_LONG_FMT "," ZEND_LONG_FMT " is out of bounds", x, y);
                        RETURN_FALSE;
                }
        }
@@ -4850,7 +4850,7 @@ PHP_FUNCTION(imageaffinematrixget)
                }
 
                default:
-                       php_error_docref(NULL, E_WARNING, "Invalid type for element %li", type);
+                       php_error_docref(NULL, E_WARNING, "Invalid type for element " ZEND_LONG_FMT, type);
                        RETURN_FALSE;
        }
 
index a1e15899c99422098f8274cf3f474b8097281d11..b751725e3f224673ad3dc784cc1c36b3a9543f13 100644 (file)
@@ -1033,7 +1033,7 @@ ZEND_FUNCTION(gmp_init)
        }
 
        if (base && (base < 2 || base > GMP_MAX_BASE)) {
-               php_error_docref(NULL, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, GMP_MAX_BASE);
+               php_error_docref(NULL, E_WARNING, "Bad base for conversion: " ZEND_LONG_FMT " (should be between 2 and %d)", base, GMP_MAX_BASE);
                RETURN_FALSE;
        }
 
@@ -1049,7 +1049,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
 {
        if (size < 1) {
                php_error_docref(NULL, E_WARNING,
-                       "Word size must be positive, %pd given", size);
+                       "Word size must be positive, " ZEND_LONG_FMT " given", size);
                return FAILURE;
        }
 
@@ -1190,7 +1190,7 @@ ZEND_FUNCTION(gmp_strval)
        /* Although the maximum base in general in GMP is 62, mpz_get_str()
         * is explicitly limited to -36 when dealing with negative bases. */
        if ((base < 2 && base > -2) || base > GMP_MAX_BASE || base < -36) {
-               php_error_docref(NULL, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE);
+               php_error_docref(NULL, E_WARNING, "Bad base for conversion: " ZEND_LONG_FMT " (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE);
                RETURN_FALSE;
        }
 
index 2ce1070838bb14ae5c70be1111855bed303666c2..dcad868db48d5c86748d236569c07b3bf34f31f0 100644 (file)
@@ -2912,7 +2912,7 @@ PHP_FUNCTION(imap_utf7_decode)
 #if PHP_DEBUG
        /* warn if we computed outlen incorrectly */
        if (outp - out != outlen) {
-               php_error_docref(NULL, E_WARNING, "outp - out [%ld] != outlen [%d]", outp - out, outlen);
+               php_error_docref(NULL, E_WARNING, "outp - out [%zd] != outlen [%d]", outp - out, outlen);
        }
 #endif
 
index 3116ab9def88db868184945dfc4c2aa2c0a8628e..8905805a36d17ce4dc50217c8c12c062891f3999 100644 (file)
@@ -226,7 +226,7 @@ PHP_FUNCTION(ibase_service_attach)
                user, isc_spb_password, (char)plen, pass, host);
 
        if (spb_len > sizeof(buf) || spb_len == -1) {
-               _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
+               _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%zd)", spb_len);
                RETURN_FALSE;
        }
 
@@ -450,7 +450,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
        }
 
        if (spb_len > sizeof(buf) || spb_len <= 0) {
-               _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
+               _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%zd)", spb_len);
                RETURN_FALSE;
        }
 
index e2000c1c5f79ed0548dcc7af9cfb4b0006ba78a9..c8b8a529aa51c8819a1e2b79e16affc943c70a9f 100644 (file)
@@ -151,7 +151,7 @@ typedef void (*info_func_t)(char*);
 
 void _php_ibase_error(void);
 void _php_ibase_module_error(char *, ...)
-       PHP_ATTRIBUTE_FORMAT(printf,1,PHP_ATTR_FMT_OFFSET +2);
+       PHP_ATTRIBUTE_FORMAT(printf,1,2);
 
 /* determine if a resource is a link or transaction handle */
 #define PHP_IBASE_LINK_TRANS(zv, lh, th)                                                                                                       \
index 5653b463659487763d11ad6e31843f29f0e740e9..94752d437bbee5de8f0b5a6262d9ae0172f30543 100644 (file)
@@ -152,7 +152,7 @@ static PHP_METHOD(UConverter, fromUCallback) {
 /* {{{ php_converter_check_limits */
 static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) {
        if (available < needed) {
-               php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun %pd bytes needed, %pd available", needed, available);
+               php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun " ZEND_LONG_FMT " bytes needed, " ZEND_LONG_FMT " available", needed, available);
                return 0;
        }
        return 1;
@@ -732,7 +732,7 @@ static PHP_METHOD(UConverter, reasonText) {
                UCNV_REASON_CASE(CLOSE)
                UCNV_REASON_CASE(CLONE)
                default:
-                       php_error_docref(NULL, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason);
+                       php_error_docref(NULL, E_WARNING, "Unknown UConverterCallbackReason: " ZEND_LONG_FMT, reason);
                        RETURN_FALSE;
        }
 }
index dda1dd4fd782f35a11ad04da4139811f69bd8723..c3ae472222109750cf48a6a6ef20f1aa453dac5e 100644 (file)
@@ -79,7 +79,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
                } else {
                        if (Z_LVAL_P(ele_value) > INT32_MAX ||
                                        Z_LVAL_P(ele_value) < INT32_MIN) {
-                               spprintf(&message, 0, "datefmt_format: value %pd is out of "
+                               spprintf(&message, 0, "datefmt_format: value " ZEND_LONG_FMT " is out of "
                                                "bounds for a 32-bit integer in key '%s'",
                                                Z_LVAL_P(ele_value), key_name);
                                intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
index 369756ebdb50d88c2a5b145d2cf6ddd50afde809..5668f0ba20c741a6746e21f6cbcc185fffdd5998 100644 (file)
@@ -119,7 +119,7 @@ PHP_FUNCTION( numfmt_format )
                        break;
 
                default:
-                       php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type);
+                       php_error_docref(NULL, E_WARNING, "Unsupported format type " ZEND_LONG_FMT, type);
                        RETURN_FALSE;
                        break;
        }
index f0d42cfabea4b0a765ce50af49c2915476cbf0ec..9b414d0027f20d5fc021925843c94e496fbbf54d 100644 (file)
@@ -97,7 +97,7 @@ PHP_FUNCTION( numfmt_parse )
                        RETVAL_DOUBLE(val_double);
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type);
+                       php_error_docref(NULL, E_WARNING, "Unsupported format type " ZEND_LONG_FMT, type);
                        RETVAL_FALSE;
                        break;
        }
index c439c7358da4f516666244bec94da72b8aa630c4..501552f86a52b5629d2526cda3bfded8a35bd7cd 100644 (file)
@@ -357,7 +357,7 @@ PHP_FUNCTION(ldap_connect)
 #endif
 
        if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
-               php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
+               php_error_docref(NULL, E_WARNING, "Too many open links (" ZEND_LONG_FMT ")", LDAPG(num_links));
                RETURN_FALSE;
        }
 
@@ -370,12 +370,12 @@ PHP_FUNCTION(ldap_connect)
                        int     urllen = hostlen + sizeof( "ldap://:65535" );
 
                        if (port <= 0 || port > 65535) {
-                               php_error_docref(NULL, E_WARNING, "invalid port number: %ld", port);
+                               php_error_docref(NULL, E_WARNING, "invalid port number: " ZEND_LONG_FMT, port);
                                RETURN_FALSE;
                        }
 
                        url = emalloc(urllen);
-                       snprintf( url, urllen, "ldap://%s:%ld", host ? host : "", port );
+                       snprintf( url, urllen, "ldap://%s:" ZEND_LONG_FMT, host ? host : "", port );
                }
 
 #ifdef LDAP_API_FEATURE_X_OPENLDAP
index aea4baf6a3abbdf329251025d031afeffe55941d..88eb2b7e0cf567bc07bae3a946b423a8282f54c8 100644 (file)
@@ -254,7 +254,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
        }
 
        if (n > (PG(max_input_vars) * 2)) {
-               php_error_docref(NULL, E_WARNING, "Input variables exceeded %pd. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+               php_error_docref(NULL, E_WARNING, "Input variables exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
                goto out;
        }
 
index 333e890f3bc8889a6b41bb6af9a4708316142837..f9c5dbc76475af10f7e280e3e34d8deeceeabf98 100644 (file)
@@ -2333,7 +2333,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
        MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
 
        if (mode_in < 0) {
-               php_error_docref(NULL, E_WARNING, "mode should be non-negative, %pd passed", mode_in);
+               php_error_docref(NULL, E_WARNING, "mode should be non-negative, " ZEND_LONG_FMT " passed", mode_in);
                RETURN_FALSE;
        }
 
index 49db7bbfe60f11b9daf8f48ac9007f643000d631..e3efca25c6fbdb3068198037796e4c95b0d9a6c7 100644 (file)
@@ -156,7 +156,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
                } else {
                        mysql->persistent = persistent = TRUE;
 
-                       hash_key = strpprintf(0, "mysqli_%s_%s%ld%s%s%s", SAFE_STR(hostname), SAFE_STR(socket),
+                       hash_key = strpprintf(0, "mysqli_%s_%s" ZEND_LONG_FMT "%s%s%s", SAFE_STR(hostname), SAFE_STR(socket),
                                                                port, SAFE_STR(username), SAFE_STR(dbname),
                                                                SAFE_STR(passwd));
 
@@ -202,14 +202,14 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
                }
        }
        if (MyG(max_links) != -1 && MyG(num_links) >= MyG(max_links)) {
-               php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MyG(num_links));
+               php_error_docref(NULL, E_WARNING, "Too many open links (" ZEND_LONG_FMT ")", MyG(num_links));
                goto err;
        }
 
        if (persistent && MyG(max_persistent) != -1 &&
                (MyG(num_active_persistent) + MyG(num_inactive_persistent))>= MyG(max_persistent))
        {
-               php_error_docref(NULL, E_WARNING, "Too many open persistent links (%pd)",
+               php_error_docref(NULL, E_WARNING, "Too many open persistent links (" ZEND_LONG_FMT ")",
                                                                MyG(num_active_persistent) + MyG(num_inactive_persistent));
                goto err;
        }
@@ -1088,7 +1088,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
        }
        MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
        if (flags < 0) {
-               php_error_docref(NULL, E_WARNING, "Invalid value for parameter flags (%pd)", flags);
+               php_error_docref(NULL, E_WARNING, "Invalid value for parameter flags (" ZEND_LONG_FMT ")", flags);
                err = TRUE;
        }
        if (!name_len) {
index 120f055a3a4418b443b22ef0ad93492eed68f1a4..51861b090ca7b7801e586d89cef08a68489edcad 100644 (file)
@@ -1231,9 +1231,9 @@ PHP_MINFO_FUNCTION(oci)
 
        php_info_print_table_start();
        php_info_print_table_header(2, "Statistics", "");
-       snprintf(buf, sizeof(buf), "%pd", OCI_G(num_persistent));
+       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, OCI_G(num_persistent));
        php_info_print_table_row(2, "Active Persistent Connections", buf);
-       snprintf(buf, sizeof(buf), "%pd", OCI_G(num_links));
+       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, OCI_G(num_links));
        php_info_print_table_row(2, "Active Connections", buf);
        php_info_print_table_end();
 }
@@ -1662,7 +1662,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
        ub2 charsetid_nls_lang = 0;
 
        if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
-               php_error_docref(NULL, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
+               php_error_docref(NULL, E_WARNING, "Invalid session mode specified (" ZEND_LONG_FMT ")", session_mode);
                return NULL;
        }
        if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
@@ -1930,7 +1930,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
 
                        if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
                                /* all persistent connactions are in use, fallback to non-persistent connection creation */
-                               php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
+                               php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (" ZEND_LONG_FMT ")", OCI_G(num_persistent));
                                alloc_non_persistent = 1;
                        }
                }
index 78ba8f11fa1215711037398dcdfdc735a330639d..036b14efe8e985790fd68aa79e715b6c3e3283fb 100644 (file)
@@ -63,7 +63,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
                        /* these three are allowed */
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Unknown descriptor type %pd", type);
+                       php_error_docref(NULL, E_WARNING, "Unknown descriptor type " ZEND_LONG_FMT, type);
                        return NULL;
                        break;
        }
@@ -630,7 +630,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag)
                        /* only these two are allowed */
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Invalid flag value: %pd", flush_flag);
+                       php_error_docref(NULL, E_WARNING, "Invalid flag value: " ZEND_LONG_FMT, flush_flag);
                        return 1;
                        break;
        }
@@ -909,7 +909,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
                        /* only these two are allowed */
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Invalid temporary lob type: %pd", type);
+                       php_error_docref(NULL, E_WARNING, "Invalid temporary lob type: " ZEND_LONG_FMT, type);
                        return 1;
                        break;
        }
index 55983d3e9fbea751abb58d0af449758d2186e6ba..a570e700c810fca5014cffb060270d433b26b222 100644 (file)
@@ -1507,7 +1507,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
                convert_to_long(&tmp);
                column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
                if (!column) {
-                       php_error_docref(NULL, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp));
+                       php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", Z_LVAL(tmp));
                        zval_dtor(&tmp);
                        return NULL;
                }
@@ -1574,7 +1574,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
        convert_to_array(var);
 
        if (maxlength < -1) {
-               php_error_docref(NULL, E_WARNING, "Invalid max length value (%pd)", maxlength);
+               php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength);
                return 1;
        }
        
@@ -1605,7 +1605,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
                        bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %pd", type);
+                       php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: " ZEND_LONG_FMT, type);
                        return 1;
                        break;
        }
index 71c3b5577695ec25b5b8a06ffde903e1476d1a5f..be8a57c3410346c1694f774436400063de91b2e3 100644 (file)
@@ -683,7 +683,7 @@ static inline int accel_is_inactive(void)
        if (ZCG(accel_directives).force_restart_timeout
                && ZCSG(force_restart_time)
                && time(NULL) >= ZCSG(force_restart_time)) {
-               zend_accel_error(ACCEL_LOG_WARNING, "Forced restart at %d (after %d seconds), locked by %d", time(NULL), ZCG(accel_directives).force_restart_timeout, mem_usage_check.l_pid);
+               zend_accel_error(ACCEL_LOG_WARNING, "Forced restart at %ld (after " ZEND_LONG_FMT " seconds), locked by %d", time(NULL), ZCG(accel_directives).force_restart_timeout, mem_usage_check.l_pid);
                kill_all_lockers(&mem_usage_check);
 
                return FAILURE; /* next request should be able to restart it */
@@ -1227,11 +1227,11 @@ static zend_persistent_script *cache_script_in_file_cache(zend_persistent_script
        if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
                zend_accel_error(
                        ((char*)new_persistent_script->mem + new_persistent_script->size < (char*)ZCG(mem)) ? ACCEL_LOG_ERROR : ACCEL_LOG_WARNING,
-                       "Internal error: wrong size calculation: %s start=0x%08x, end=0x%08x, real=0x%08x\n",
+                       "Internal error: wrong size calculation: %s start=" ZEND_ADDR_FMT ", end=" ZEND_ADDR_FMT ", real=" ZEND_ADDR_FMT "\n",
                        ZSTR_VAL(new_persistent_script->script.filename),
-                       new_persistent_script->mem,
-                       (char *)new_persistent_script->mem + new_persistent_script->size,
-                       ZCG(mem));
+                       (size_t)new_persistent_script->mem,
+                       (size_t)((char *)new_persistent_script->mem + new_persistent_script->size),
+                       (size_t)ZCG(mem));
        }
 
        new_persistent_script->dynamic_members.checksum = zend_accel_script_checksum(new_persistent_script);
@@ -1321,11 +1321,11 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
        if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
                zend_accel_error(
                        ((char*)new_persistent_script->mem + new_persistent_script->size < (char*)ZCG(mem)) ? ACCEL_LOG_ERROR : ACCEL_LOG_WARNING,
-                       "Internal error: wrong size calculation: %s start=0x%08x, end=0x%08x, real=0x%08x\n",
+                       "Internal error: wrong size calculation: %s start=" ZEND_ADDR_FMT ", end=" ZEND_ADDR_FMT ", real=" ZEND_ADDR_FMT "\n",
                        ZSTR_VAL(new_persistent_script->script.filename),
-                       new_persistent_script->mem,
-                       (char *)new_persistent_script->mem + new_persistent_script->size,
-                       ZCG(mem));
+                       (size_t)new_persistent_script->mem,
+                       (size_t)((char *)new_persistent_script->mem + new_persistent_script->size),
+                       (size_t)ZCG(mem));
        }
 
        new_persistent_script->dynamic_members.checksum = zend_accel_script_checksum(new_persistent_script);
@@ -1333,7 +1333,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
        /* store script structure in the hash table */
        bucket = zend_accel_hash_update(&ZCSG(hash), ZSTR_VAL(new_persistent_script->script.filename), ZSTR_LEN(new_persistent_script->script.filename), 0, new_persistent_script);
        if (bucket) {
-               zend_accel_error(ACCEL_LOG_INFO, "Cached script '%s'", new_persistent_script->script.filename);
+               zend_accel_error(ACCEL_LOG_INFO, "Cached script '%s'", ZSTR_VAL(new_persistent_script->script.filename));
                if (key &&
                    /* key may contain non-persistent PHAR aliases (see issues #115 and #149) */
                    memcmp(key, "phar://", sizeof("phar://") - 1) != 0 &&
@@ -1790,8 +1790,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
                unsigned int checksum = zend_accel_script_checksum(persistent_script);
                if (checksum != persistent_script->dynamic_members.checksum ) {
                        /* The checksum is wrong */
-                       zend_accel_error(ACCEL_LOG_INFO, "Checksum failed for '%s':  expected=0x%0.8X, found=0x%0.8X",
-                                                        persistent_script->script.filename, persistent_script->dynamic_members.checksum, checksum);
+                       zend_accel_error(ACCEL_LOG_INFO, "Checksum failed for '%s':  expected=0x%08x, found=0x%08x",
+                                                        ZSTR_VAL(persistent_script->script.filename), persistent_script->dynamic_members.checksum, checksum);
                        zend_shared_alloc_lock();
                        if (!persistent_script->corrupted) {
                                persistent_script->corrupted = 1;
index 55226050131b6aa08267fea94d3ef362670169f8..4b8d82b4ac01fb96f228ff1304b7420f613c56d9 100644 (file)
@@ -28,6 +28,6 @@
 #define ACCEL_LOG_INFO                                 3
 #define ACCEL_LOG_DEBUG                                        4
 
-void zend_accel_error(int type, const char *format, ...);
+void zend_accel_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);;
 
 #endif /* _ZEND_ACCELERATOR_DEBUG_H */
index 61698b4a9f4c59c3ec04eccb956bc0d46524a983..0e1069836c51e0a1700009e06b59b1739a3220e5 100644 (file)
@@ -200,7 +200,7 @@ static ZEND_INI_MH(OnUpdateMaxWastedPercentage)
 
                percentage = 5;
                zend_accel_error(ACCEL_LOG_WARNING, "opcache.max_wasted_percentage must be set between 1 and 50.\n");
-               zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use 5%.\n");
+               zend_accel_error(ACCEL_LOG_WARNING, ACCELERATOR_PRODUCT_NAME " will use 5%%.\n");
                if ((ini_entry = zend_hash_str_find_ptr(EG(ini_directives),
                                        "opcache.max_wasted_percentage",
                                        sizeof("opcache.max_wasted_percentage")-1)) == NULL) {
@@ -474,33 +474,33 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
                        char buf[32];
                        php_info_print_table_row(2, "Startup", "OK");
                        php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model());
-                       snprintf(buf, sizeof(buf), "%pd", (zend_ulong)ZCSG(hits));
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, (zend_ulong)ZCSG(hits));
                        php_info_print_table_row(2, "Cache hits", buf);
-                       snprintf(buf, sizeof(buf), "%pd", ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses));
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses));
                        php_info_print_table_row(2, "Cache misses", buf);
                        snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory));
                        php_info_print_table_row(2, "Used memory", buf);
-                       snprintf(buf, sizeof(buf), "%pd", zend_shared_alloc_get_free_memory());
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, zend_shared_alloc_get_free_memory());
                        php_info_print_table_row(2, "Free memory", buf);
-                       snprintf(buf, sizeof(buf), "%pd", ZSMMG(wasted_shared_memory));
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZSMMG(wasted_shared_memory));
                        php_info_print_table_row(2, "Wasted memory", buf);
                        if (ZCSG(interned_strings_start) && ZCSG(interned_strings_end) && ZCSG(interned_strings_top)) {
-                               snprintf(buf, sizeof(buf), "%pd", ZCSG(interned_strings_top) - ZCSG(interned_strings_start));
+                               snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(interned_strings_top) - ZCSG(interned_strings_start));
                                php_info_print_table_row(2, "Interned Strings Used memory", buf);
-                               snprintf(buf, sizeof(buf), "%pd", ZCSG(interned_strings_end) - ZCSG(interned_strings_top));
+                               snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(interned_strings_end) - ZCSG(interned_strings_top));
                                php_info_print_table_row(2, "Interned Strings Free memory", buf);
                        }
-                       snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).num_direct_entries);
+                       snprintf(buf, sizeof(buf), "%d", ZCSG(hash).num_direct_entries);
                        php_info_print_table_row(2, "Cached scripts", buf);
-                       snprintf(buf, sizeof(buf), "%ld", ZCSG(hash).num_entries);
+                       snprintf(buf, sizeof(buf), "%d", ZCSG(hash).num_entries);
                        php_info_print_table_row(2, "Cached keys", buf);
-                       snprintf(buf, sizeof(buf), "%pd", ZCSG(hash).max_num_entries);
+                       snprintf(buf, sizeof(buf), "%d", ZCSG(hash).max_num_entries);
                        php_info_print_table_row(2, "Max keys", buf);
-                       snprintf(buf, sizeof(buf), "%pd", ZCSG(oom_restarts));
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(oom_restarts));
                        php_info_print_table_row(2, "OOM restarts", buf);
-                       snprintf(buf, sizeof(buf), "%pd", ZCSG(hash_restarts));
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(hash_restarts));
                        php_info_print_table_row(2, "Hash keys restarts", buf);
-                       snprintf(buf, sizeof(buf), "%pd", ZCSG(manual_restarts));
+                       snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCSG(manual_restarts));
                        php_info_print_table_row(2, "Manual restarts", buf);
                }
        }
index ff42c4cf0b88299f341509c82183ace4eb92d37f..28cdc44097d413e15c565d2a637fee5bcaa86f5f 100644 (file)
@@ -99,7 +99,7 @@ void zend_shared_alloc_create_lock(char *lockfile_path)
 
 static void no_memory_bailout(size_t allocate_size, char *error)
 {
-       zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %ld bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno );
+       zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %zu bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno );
 }
 
 static void copy_shared_segments(void *to, void *from, int count, int size)
@@ -299,7 +299,7 @@ static size_t zend_shared_alloc_get_largest_free_block(void)
 #define MIN_FREE_MEMORY 64*1024
 
 #define SHARED_ALLOC_FAILED() do {             \
-               zend_accel_error(ACCEL_LOG_WARNING, "Not enough free shared space to allocate %pd bytes (%pd bytes free)", (zend_long)size, (zend_long)ZSMMG(shared_free)); \
+               zend_accel_error(ACCEL_LOG_WARNING, "Not enough free shared space to allocate %zd bytes (%zd bytes free)", (size_t)size, (size_t)ZSMMG(shared_free)); \
                if (zend_shared_alloc_get_largest_free_block() < MIN_FREE_MEMORY) { \
                        ZSMMG(memory_exhausted) = 1; \
                } \
index b462d0e66cdfbdc2359b632503980590bd413a64..72efb44f612215510439d4e33b4a2f89856b2a41 100644 (file)
@@ -5637,7 +5637,7 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
        if (mode->is_aead) {
                if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) {
                        php_error_docref(NULL, E_WARNING,
-                                       "Setting of IV length for AEAD mode failed, the expected length is %d bytes",
+                                       "Setting of IV length for AEAD mode failed, the expected length is %zd bytes",
                                        iv_required_len);
                        return FAILURE;
                }
index e0fc9d74f2d4064f709eb886ef3bd9b86f31648e..c6b9ebdcdcc42780379d2f3b8066f93327a4c92b 100644 (file)
@@ -159,7 +159,7 @@ static PHP_GINIT_FUNCTION(pdo)
 PDO_API int php_pdo_register_driver(pdo_driver_t *driver) /* {{{ */
 {
        if (driver->api_version != PDO_DRIVER_API) {
-               zend_error(E_ERROR, "PDO: driver %s requires PDO API version %pd; this is PDO version %d",
+               zend_error(E_ERROR, "PDO: driver %s requires PDO API version " ZEND_ULONG_FMT "; this is PDO version %d",
                        driver->driver_name, driver->api_version, PDO_DRIVER_API);
                return FAILURE;
        }
index 624281c18b97f12f4b97036be286cf51dbcb452b..ffb1b6ef035304b191261a534847d19fc7a3835e 100644 (file)
@@ -141,7 +141,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt) /* {{{ */
        }
 
        if (supp) {
-               message = strpprintf(0, "SQLSTATE[%s]: %s: %ld %s", *pdo_err, msg, native_code, supp);
+               message = strpprintf(0, "SQLSTATE[%s]: %s: " ZEND_LONG_FMT " %s", *pdo_err, msg, native_code, supp);
        } else {
                message = strpprintf(0, "SQLSTATE[%s]: %s", *pdo_err, msg);
        }
index c2f3c133990f702542cc91108551d6de8f54ec7c..bd8a054718b8d6160e6fc21b499d2d13a0040a3d 100644 (file)
@@ -2123,10 +2123,10 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
                                php_stream_printf(out, "Key: Name: [%zd] %.*s\n",
                                        ZSTR_LEN(key), (int) ZSTR_LEN(key), ZSTR_VAL(key));
                        } else {
-                               php_stream_printf(out, "Key: Position #%pd:\n", num);
+                               php_stream_printf(out, "Key: Position #" ZEND_ULONG_FMT ":\n", num);
                        }
 
-                       php_stream_printf(out, "paramno=%pd\nname=[%zd] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
+                       php_stream_printf(out, "paramno=" ZEND_LONG_FMT "\nname=[%zd] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
                                        param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name) : 0,
                                        param->name ? ZSTR_VAL(param->name) : "",
                                        param->is_param,
index 3f92525506cbef84a3787cacf220ffcfff729963..a8229fe88e27d5f997abb6e485312be30c7e60fe 100644 (file)
@@ -1218,13 +1218,13 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
 
        /* support both full connection string & connection string + login and/or password */
        if (tmp_user && tmp_pass) {
-               spprintf(&conn_str, 0, "%s user='%s' password='%s' connect_timeout=%pd", (char *) dbh->data_source, ZSTR_VAL(tmp_user), ZSTR_VAL(tmp_pass), connect_timeout);
+               spprintf(&conn_str, 0, "%s user='%s' password='%s' connect_timeout=" ZEND_LONG_FMT, (char *) dbh->data_source, ZSTR_VAL(tmp_user), ZSTR_VAL(tmp_pass), connect_timeout);
        } else if (tmp_user) {
-               spprintf(&conn_str, 0, "%s user='%s' connect_timeout=%pd", (char *) dbh->data_source, ZSTR_VAL(tmp_user), connect_timeout);
+               spprintf(&conn_str, 0, "%s user='%s' connect_timeout=" ZEND_LONG_FMT, (char *) dbh->data_source, ZSTR_VAL(tmp_user), connect_timeout);
        } else if (tmp_pass) {
-               spprintf(&conn_str, 0, "%s password='%s' connect_timeout=%pd", (char *) dbh->data_source, ZSTR_VAL(tmp_pass), connect_timeout);
+               spprintf(&conn_str, 0, "%s password='%s' connect_timeout=" ZEND_LONG_FMT, (char *) dbh->data_source, ZSTR_VAL(tmp_pass), connect_timeout);
        } else {
-               spprintf(&conn_str, 0, "%s connect_timeout=%pd", (char *) dbh->data_source, connect_timeout);
+               spprintf(&conn_str, 0, "%s connect_timeout=" ZEND_LONG_FMT, (char *) dbh->data_source, connect_timeout);
        }
 
        H->server = PQconnectdb(conn_str);
index ee06cfc439f2e73262493f7bdc509bd0e6824acb..6134a733ca1464be4bb507ed5c4488cae0cadfef 100644 (file)
@@ -424,8 +424,8 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
                        case PDO_FETCH_ORI_PRIOR:       spprintf(&ori_str, 0, "BACKWARD"); break;
                        case PDO_FETCH_ORI_FIRST:       spprintf(&ori_str, 0, "FIRST"); break;
                        case PDO_FETCH_ORI_LAST:        spprintf(&ori_str, 0, "LAST"); break;
-                       case PDO_FETCH_ORI_ABS:         spprintf(&ori_str, 0, "ABSOLUTE %pd", offset); break;
-                       case PDO_FETCH_ORI_REL:         spprintf(&ori_str, 0, "RELATIVE %pd", offset); break;
+                       case PDO_FETCH_ORI_ABS:         spprintf(&ori_str, 0, "ABSOLUTE " ZEND_LONG_FMT, offset); break;
+                       case PDO_FETCH_ORI_REL:         spprintf(&ori_str, 0, "RELATIVE " ZEND_LONG_FMT, offset); break;
                        default:
                                return 0;
                }
index 16a84ffcd82bbd94ebe63dce3bdc1c6cb6f7183f..b567c3c8a556141c39697b08a71f558541295503 100644 (file)
@@ -1343,12 +1343,12 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 
                        if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) {
                                php_error_docref(NULL, E_WARNING,
-                                                                "Cannot create new link. Too many open links (%pd)", PGG(num_links));
+                                                                "Cannot create new link. Too many open links (" ZEND_LONG_FMT ")", PGG(num_links));
                                goto err;
                        }
                        if (PGG(max_persistent) != -1 && PGG(num_persistent) >= PGG(max_persistent)) {
                                php_error_docref(NULL, E_WARNING,
-                                                                "Cannot create new link. Too many open persistent links (%pd)", PGG(num_persistent));
+                                                                "Cannot create new link. Too many open persistent links (" ZEND_LONG_FMT ")", PGG(num_persistent));
                                goto err;
                        }
 
@@ -1441,7 +1441,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        }
                }
                if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) {
-                       php_error_docref(NULL, E_WARNING, "Cannot create new link. Too many open links (%pd)", PGG(num_links));
+                       php_error_docref(NULL, E_WARNING, "Cannot create new link. Too many open links (" ZEND_LONG_FMT ")", PGG(num_links));
                        goto err;
                }
 
@@ -2681,7 +2681,7 @@ PHP_FUNCTION(pg_fetch_result)
                }
        } else {
                if (row < 0 || row >= PQntuples(pgsql_result)) {
-                       php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+                       php_error_docref(NULL, E_WARNING, "Unable to jump to row " ZEND_LONG_FMT " on PostgreSQL result index " ZEND_LONG_FMT,
                                                        row, Z_LVAL_P(result));
                        RETURN_FALSE;
                }
@@ -2772,7 +2772,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
 
        if (use_row) {
                if (row < 0 || row >= PQntuples(pgsql_result)) {
-                       php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+                       php_error_docref(NULL, E_WARNING, "Unable to jump to row " ZEND_LONG_FMT " on PostgreSQL result index " ZEND_LONG_FMT,
                                                        row, Z_LVAL_P(result));
                        RETURN_FALSE;
                }
@@ -2858,7 +2858,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
                        fcc.object = Z_OBJ_P(return_value);
 
                        if (zend_call_function(&fci, &fcc) == FAILURE) {
-                               zend_throw_exception_ex(zend_ce_exception, 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+                               zend_throw_exception_ex(zend_ce_exception, 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
                        } else {
                                zval_ptr_dtor(&retval);
                        }
@@ -2866,7 +2866,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
                                efree(fci.params);
                        }
                } else if (ctor_params) {
-                       zend_throw_exception_ex(zend_ce_exception, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+                       zend_throw_exception_ex(zend_ce_exception, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
                }
        }
 }
@@ -2964,7 +2964,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
 
        num_fields = PQnfields(pgsql_result);
        if (colno >= (zend_long)num_fields || colno < 0) {
-               php_error_docref(NULL, E_WARNING, "Invalid column number '%pd'", colno);
+               php_error_docref(NULL, E_WARNING, "Invalid column number '" ZEND_LONG_FMT "'", colno);
                RETURN_FALSE;
        }
 
@@ -3048,7 +3048,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
                }
        } else {
                if (row < 0 || row >= PQntuples(pgsql_result)) {
-                       php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+                       php_error_docref(NULL, E_WARNING, "Unable to jump to row " ZEND_LONG_FMT " on PostgreSQL result index " ZEND_LONG_FMT,
                                                        row, Z_LVAL_P(result));
                        RETURN_FALSE;
                }
@@ -3582,11 +3582,11 @@ PHP_FUNCTION(pg_lo_write)
 
        if (argc > 2) {
                if (z_len > (zend_long)str_len) {
-                       php_error_docref(NULL, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len);
+                       php_error_docref(NULL, E_WARNING, "Cannot write more than buffer size %d. Tried to write " ZEND_LONG_FMT, str_len, z_len);
                        RETURN_FALSE;
                }
                if (z_len < 0) {
-                       php_error_docref(NULL, E_WARNING, "Buffer size must be larger than 0, but %pd was specified", z_len);
+                       php_error_docref(NULL, E_WARNING, "Buffer size must be larger than 0, but " ZEND_LONG_FMT " was specified", z_len);
                        RETURN_FALSE;
                }
                len = z_len;
index 54610939dd1a5acb095fdaeaaf591f74d46fc26b..a390a1fa5c061561b42b860828db37f29264e457 100644 (file)
@@ -200,7 +200,7 @@ phar_it:
                        }
 
                        if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
-                               php_error_docref(NULL, E_WARNING, "Failed to seek to position %pd in the stream", offset);
+                               php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset);
                                php_stream_close(stream);
                                RETURN_FALSE;
                        }
index 75c2487ffd92e1f53ec33d5cc0cf748ef3679f2a..a287dc996b75f08fef9e19b580dc72c9879ceb9c 100644 (file)
@@ -1404,7 +1404,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
 
        if (!value) {
                /* failure in get_current_data */
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned no value", ZSTR_VAL(ce->name));
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned no value", ZSTR_VAL(ce->name));
                return ZEND_HASH_APPLY_STOP;
        }
 
@@ -1415,7 +1415,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
                        php_stream_from_zval_no_verify(fp, value);
 
                        if (!fp) {
-                               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %v returned an invalid stream handle", ZSTR_VAL(ce->name));
+                               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %s returned an invalid stream handle", ZSTR_VAL(ce->name));
                                return ZEND_HASH_APPLY_STOP;
                        }
 
@@ -1429,7 +1429,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
 
                                if (Z_TYPE(key) != IS_STRING) {
                                        zval_dtor(&key);
-                                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
+                                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                                        return ZEND_HASH_APPLY_STOP;
                                }
 
@@ -1439,7 +1439,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
                                save = str_key;
                                zval_dtor(&key);
                        } else {
-                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
+                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                                return ZEND_HASH_APPLY_STOP;
                        }
 
@@ -1453,7 +1453,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
                                spl_filesystem_object *intern = (spl_filesystem_object*)((char*)Z_OBJ_P(value) - Z_OBJ_P(value)->handlers->offset);
 
                                if (!base_len) {
-                                       zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ZSTR_VAL(ce->name));
+                                       zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %s returns an SplFileInfo object, so base directory must be specified", ZSTR_VAL(ce->name));
                                        return ZEND_HASH_APPLY_STOP;
                                }
 
@@ -1497,7 +1497,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
                        }
                        /* fall-through */
                default:
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid value (must return a string)", ZSTR_VAL(ce->name));
+                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid value (must return a string)", ZSTR_VAL(ce->name));
                        return ZEND_HASH_APPLY_STOP;
        }
 
@@ -1537,7 +1537,7 @@ phar_spl_fileinfo:
                        }
 
                } else {
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ZSTR_VAL(ce->name), fname, base);
+                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned a path \"%s\" that is not in the base directory \"%s\"", ZSTR_VAL(ce->name), fname, base);
 
                        if (save) {
                                efree(save);
@@ -1557,7 +1557,7 @@ phar_spl_fileinfo:
 
                        if (Z_TYPE(key) != IS_STRING) {
                                zval_dtor(&key);
-                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
+                               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                                return ZEND_HASH_APPLY_STOP;
                        }
 
@@ -1567,13 +1567,13 @@ phar_spl_fileinfo:
                        save = str_key;
                        zval_dtor(&key);
                } else {
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
+                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                        return ZEND_HASH_APPLY_STOP;
                }
        }
 
        if (php_check_open_basedir(fname)) {
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ZSTR_VAL(ce->name), fname);
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned a path \"%s\" that open_basedir prevents opening", ZSTR_VAL(ce->name), fname);
 
                if (save) {
                        efree(save);
@@ -1590,7 +1590,7 @@ phar_spl_fileinfo:
        fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened);
 
        if (!fp) {
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a file that could not be opened \"%s\"", ZSTR_VAL(ce->name), fname);
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned a file that could not be opened \"%s\"", ZSTR_VAL(ce->name), fname);
 
                if (save) {
                        efree(save);
@@ -3525,7 +3525,7 @@ PHP_METHOD(Phar, offsetGet)
                }
 
                if (fname_len >= sizeof(".phar")-1 && !memcmp(fname, ".phar", sizeof(".phar")-1)) {
-                       zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot directly get any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
+                       zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot directly get any files or directories in magic \".phar\" directory");
                        return;
                }
 
@@ -3552,7 +3552,7 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
        php_stream *contents_file;
 
        if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1) && (filename[5] == '/' || filename[5] == '\\' || filename[5] == '\0')) {
-               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create any files in magic \".phar\" directory");
                return;
        }
 
@@ -3669,7 +3669,7 @@ PHP_METHOD(Phar, offsetSet)
        }
 
        if (fname_len >= sizeof(".phar")-1 && !memcmp(fname, ".phar", sizeof(".phar")-1)) {
-               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set any files or directories in magic \".phar\" directory");
                return;
        }
 
index 58d7f4a4c9b7a2a4d329354070112565c9ea86f0..7db00749296b421eba31d082bab3c4c5cf624802 100644 (file)
@@ -230,7 +230,7 @@ static void php_pspell_close_config(zend_resource *rsrc)
 #define PSPELL_FETCH_CONFIG  do { \
        zval *res = zend_hash_index_find(&EG(regular_list), conf); \
        if (res == NULL || Z_RES_P(res)->type != le_pspell_config) { \
-               php_error_docref(NULL, E_WARNING, "%ld is not a PSPELL config index", conf); \
+               php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " is not a PSPELL config index", conf); \
                RETURN_FALSE; \
        } \
        config = (PspellConfig *)Z_RES_P(res)->ptr; \
@@ -239,7 +239,7 @@ static void php_pspell_close_config(zend_resource *rsrc)
 #define PSPELL_FETCH_MANAGER do { \
        zval *res = zend_hash_index_find(&EG(regular_list), scin); \
        if (res == NULL || Z_RES_P(res)->type != le_pspell) { \
-               php_error_docref(NULL, E_WARNING, "%ld is not a PSPELL result index", scin); \
+               php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " is not a PSPELL result index", scin); \
                RETURN_FALSE; \
        } \
        manager = (PspellManager *)Z_RES_P(res)->ptr; \
@@ -808,7 +808,7 @@ static PHP_FUNCTION(pspell_config_ignore)
 
        PSPELL_FETCH_CONFIG;
 
-       snprintf(ignore_str, sizeof(ignore_str), "%ld", ignore);
+       snprintf(ignore_str, sizeof(ignore_str), ZEND_LONG_FMT, ignore);
 
        pspell_config_replace(config, "ignore", ignore_str);
        RETURN_TRUE;
index a3b4de82f0fae2cc89a39ad2105170878a466426..9b4d40bac933123d0690762920f0afd718fc0a7f 100644 (file)
@@ -300,7 +300,7 @@ PHPAPI void php_session_reset_id(void);
        ZEND_HASH_FOREACH_KEY(_ht, num_key, key) {                                              \
                if (key == NULL) {                                                                                      \
                        php_error_docref(NULL, E_NOTICE,                                \
-                                       "Skipping numeric key %pd", num_key);                   \
+                                       "Skipping numeric key " ZEND_ULONG_FMT, num_key);                       \
                        continue;                                                                                               \
                }                                                                                                                       \
                if ((struc = php_get_session_var(key))) {                       \
index 8a1ef4915f2024925ab80334b809c691c2cc0196..fc4d059aa17de2c39753c7766e57a6f112c541d6 100644 (file)
@@ -323,7 +323,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
                                }
                                if (sxe->iter.type == SXE_ITER_NONE) {
                                        if (member && Z_LVAL_P(member) > 0) {
-                                               php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
+                                               php_error_docref(NULL, E_WARNING, "Cannot add element %s number " ZEND_LONG_FMT " when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
                                        }
                                } else if (member) {
                                        node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt);
@@ -334,7 +334,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
                                        _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
                                } else if (type == BP_VAR_W || type == BP_VAR_RW) {
                                        if (member && cnt < Z_LVAL_P(member)) {
-                                               php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
+                                               php_error_docref(NULL, E_WARNING, "Cannot add element %s number " ZEND_LONG_FMT " when only " ZEND_LONG_FMT " such elements exist", mynode->name, Z_LVAL_P(member), cnt);
                                        }
                                        node = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, NULL);
                                        _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
@@ -579,7 +579,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
                                        newnode = node;
                                        ++counter;
                                        if (member && Z_LVAL_P(member) > 0) {
-                                               php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
+                                               php_error_docref(NULL, E_WARNING, "Cannot add element %s number " ZEND_LONG_FMT " when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
                                                retval = FAILURE;
                                        }
                                } else if (member) {
@@ -627,14 +627,14 @@ next_iter:
                                }
                        } else if (!member || Z_TYPE_P(member) == IS_LONG) {
                                if (member && cnt < Z_LVAL_P(member)) {
-                                       php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
+                                       php_error_docref(NULL, E_WARNING, "Cannot add element %s number " ZEND_LONG_FMT " when only " ZEND_LONG_FMT " such elements exist", mynode->name, Z_LVAL_P(member), cnt);
                                        retval = FAILURE;
                                }
                                newnode = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
                        }
                } else if (attribs) {
                        if (Z_TYPE_P(member) == IS_LONG) {
-                               php_error_docref(NULL, E_WARNING, "Cannot change attribute number %pd when only %d attributes exist", Z_LVAL_P(member), nodendx);
+                               php_error_docref(NULL, E_WARNING, "Cannot change attribute number " ZEND_LONG_FMT " when only %d attributes exist", Z_LVAL_P(member), nodendx);
                                retval = FAILURE;
                        } else {
                                newnode = (xmlNodePtr)xmlNewProp(node, (xmlChar *)Z_STRVAL_P(member), value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
index 38d82db670f3e8f474b0028a46cc098b24080249..7c4faa6cf32c93d6e5555414ceed91c98da9d8fb 100644 (file)
@@ -1752,7 +1752,7 @@ PHP_FUNCTION(snmp_set_valueretrieval)
                        SNMP_G(valueretrieval) = method;
                        RETURN_TRUE;
        } else {
-               php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method);
+               php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '" ZEND_LONG_FMT "'", method);
                RETURN_FALSE;
        }
 }
@@ -2183,7 +2183,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval)
        if (Z_LVAL_P(newval) > 0) {
                snmp_object->max_oids = Z_LVAL_P(newval);
        } else {
-               php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval));
+               php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got " ZEND_LONG_FMT, Z_LVAL_P(newval));
        }
 
        if (newval == &ztmp) {
@@ -2210,7 +2210,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new
        if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) {
                snmp_object->valueretrieval = Z_LVAL_P(newval);
        } else {
-               php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval));
+               php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '" ZEND_LONG_FMT "'", Z_LVAL_P(newval));
                ret = FAILURE;
        }
 
@@ -2260,7 +2260,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *
                        snmp_object->oid_output_format = Z_LVAL_P(newval);
                        break;
                default:
-                       php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval));
+                       php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '" ZEND_LONG_FMT "'", Z_LVAL_P(newval));
                        ret = FAILURE;
                        break;
        }
index 803a5cd596481c408aaacf118d079e24b345c0fb..6080444cf8772491893dab832b516e24d4a10a87 100644 (file)
@@ -2879,7 +2879,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
                ta = php_localtime_r(&timestamp, &tmbuf);
                /*ta = php_gmtime_r(&timestamp, &tmbuf);*/
                if (!ta) {
-                       soap_error1(E_ERROR, "Encoding: Invalid timestamp %pd", Z_LVAL_P(data));
+                       soap_error1(E_ERROR, "Encoding: Invalid timestamp " ZEND_LONG_FMT, Z_LVAL_P(data));
                }
 
                buf = (char *) emalloc(buf_len);
index 7c9183613c698c8194fd8f8ef2de9d06c257d388..26221962d67294d850a9fbe580086c6342bd3afb 100644 (file)
@@ -651,7 +651,7 @@ try_again:
                                        if ((tmp = zend_hash_str_find(Z_ARRVAL_P(digest), "nc", sizeof("nc")-1)) != NULL &&
                                            Z_TYPE_P(tmp) == IS_LONG) {
                                                Z_LVAL_P(tmp)++;
-                                               snprintf(nc, sizeof(nc), "%08ld", Z_LVAL_P(tmp));
+                                               snprintf(nc, sizeof(nc), "%08" ZEND_LONG_FMT_SPEC, Z_LVAL_P(tmp));
                                        } else {
                                                add_assoc_long(digest, "nc", 1);
                                                strcpy(nc, "00000001");
index c842ce51191838205af6294dab6828b9cd5ceb19..885116e2e9bbb04e4b69ea7f3a2ccba1c6dcd7ce 100644 (file)
@@ -970,7 +970,7 @@ PHP_METHOD(SoapFault, __toString)
        convert_to_long(line);
        convert_to_string(&trace);
 
-       str = strpprintf(0, "SoapFault exception: [%s] %s in %s:%pd\nStack trace:\n%s",
+       str = strpprintf(0, "SoapFault exception: [%s] %s in %s:" ZEND_LONG_FMT "\nStack trace:\n%s",
                       Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line),
                       Z_STRLEN(trace) ? Z_STRVAL(trace) : "#0 {main}\n");
 
@@ -1273,7 +1273,7 @@ PHP_METHOD(SoapServer, setPersistence)
                                value == SOAP_PERSISTENCE_REQUEST) {
                                service->soap_class.persistence = value;
                        } else {
-                               php_error_docref(NULL, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
+                               php_error_docref(NULL, E_WARNING, "Tried to set persistence with bogus value (" ZEND_LONG_FMT ")", value);
                                return;
                        }
                } else {
index f2621f65d0549ae16dae5de5fcb7ed1e8c3d0fc6..892442a88fd33c0d924c237ed3f27d4e6d5f769c 100644 (file)
@@ -656,7 +656,7 @@ static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_
        }
        if (ZSTR_LEN(path_str) >= sizeof(saddr->sun_path)) {
                do_from_zval_err(ctx, "the path is too long, the maximum permitted "
-                               "length is %ld", sizeof(saddr->sun_path) - 1);
+                               "length is %zd", sizeof(saddr->sun_path) - 1);
                return;
        }
 
@@ -965,7 +965,7 @@ static void to_zval_read_cmsg_data(const char *cmsghdr_c, zval *zv, res_context
        }
        if (CMSG_LEN(entry->size) > cmsg->cmsg_len) {
                do_to_zval_err(ctx, "the cmsghdr structure is unexpectedly small; "
-                               "expected a length of at least %pd, but got %pd",
+                               "expected a length of at least " ZEND_LONG_FMT ", but got " ZEND_LONG_FMT,
                                (zend_long)CMSG_LEN(entry->size), (zend_long)cmsg->cmsg_len);
                return;
        }
@@ -1062,8 +1062,8 @@ static void from_zval_write_msghdr_buffer_size(const zval *elem, char *msghdr_c,
        }
 
        if (lval < 0 || lval > MAX_USER_BUFF_SIZE) {
-               do_from_zval_err(ctx, "the buffer size must be between 1 and %pd; "
-                               "given %pd", (zend_long)MAX_USER_BUFF_SIZE, lval);
+               do_from_zval_err(ctx, "the buffer size must be between 1 and " ZEND_LONG_FMT "; "
+                               "given " ZEND_LONG_FMT, (zend_long)MAX_USER_BUFF_SIZE, lval);
                return;
        }
 
@@ -1238,7 +1238,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
        if (Z_TYPE_P(zv) == IS_LONG) {
                if (Z_LVAL_P(zv) < 0 || Z_LVAL_P(zv) > UINT_MAX) { /* allow 0 (unspecified interface) */
                        do_from_zval_err(ctx, "the interface index cannot be negative or "
-                                       "larger than %u; given %pd", UINT_MAX, Z_LVAL_P(zv));
+                                       "larger than %u; given " ZEND_LONG_FMT, UINT_MAX, Z_LVAL_P(zv));
                } else {
                        ret = (unsigned)Z_LVAL_P(zv);
                }
@@ -1400,7 +1400,7 @@ void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
 
        if (*cmsg_len < data_offset) {
                do_to_zval_err(ctx, "length of cmsg is smaller than its data member "
-                               "offset (%pd vs %pd)", (zend_long)*cmsg_len, (zend_long)data_offset);
+                               "offset (" ZEND_LONG_FMT " vs " ZEND_LONG_FMT ")", (zend_long)*cmsg_len, (zend_long)data_offset);
                return;
        }
        num_elems = (*cmsg_len - data_offset) / sizeof(int);
index 6d37bfb1ddf67a2b2d70ba2594e3f59f86247640..75984ec3233b8639007b28c2ad4fa4b3f4fc3510 100644 (file)
@@ -93,7 +93,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out)
                if (Z_LVAL_P(val) < 0 || Z_LVAL_P(val) > UINT_MAX) {
                        php_error_docref(NULL, E_WARNING,
                                "the interface index cannot be negative or larger than %u;"
-                               " given %pd", UINT_MAX, Z_LVAL_P(val));
+                               " given " ZEND_LONG_FMT, UINT_MAX, Z_LVAL_P(val));
                        ret = FAILURE;
                } else {
                        *out = Z_LVAL_P(val);
index 7471ad143aaf18e3290bc9bc59006a9a070ef0e2..72d8cfc47e4c7f2c257cbbe41cc63485127dd743 100644 (file)
@@ -71,7 +71,7 @@ inline ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
 #define LONG_CHECK_VALID_INT(l) \
        do { \
                if ((l) < INT_MIN && (l) > INT_MAX) { \
-                       php_error_docref0(NULL, E_WARNING, "The value %pd does not fit inside " \
+                       php_error_docref0(NULL, E_WARNING, "The value " ZEND_LONG_FMT " does not fit inside " \
                                        "the boundaries of a native integer", (l)); \
                        return; \
                } \
@@ -299,7 +299,7 @@ PHP_FUNCTION(socket_cmsg_space)
 
        entry = get_ancillary_reg_entry(level, type);
        if (entry == NULL) {
-               php_error_docref0(NULL, E_WARNING, "The pair level %pd/type %pd is "
+               php_error_docref0(NULL, E_WARNING, "The pair level " ZEND_LONG_FMT "/type " ZEND_LONG_FMT " is "
                                "not supported by PHP", level, type);
                return;
        }
@@ -308,7 +308,7 @@ PHP_FUNCTION(socket_cmsg_space)
                        (zend_long)CMSG_SPACE(0) - 15L) / entry->var_el_size) {
                /* the -15 is to account for any padding CMSG_SPACE may add after the data */
                php_error_docref0(NULL, E_WARNING, "The value for the "
-                               "third argument (%pd) is too large", n);
+                               "third argument (" ZEND_LONG_FMT ") is too large", n);
                return;
        }
 
index 63674c50d73152125d34d399a4b289c73f83d6ea..c289b0f9a3ed97a45ef33d3ee05ccdbf135ae62c 100644 (file)
@@ -1377,12 +1377,12 @@ PHP_FUNCTION(socket_create)
                && arg1 != AF_INET6
 #endif
                && arg1 != AF_INET) {
-               php_error_docref(NULL, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", arg1);
+               php_error_docref(NULL, E_WARNING, "invalid socket domain [" ZEND_LONG_FMT "] specified for argument 1, assuming AF_INET", arg1);
                arg1 = AF_INET;
        }
 
        if (arg2 > 10) {
-               php_error_docref(NULL, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", arg2);
+               php_error_docref(NULL, E_WARNING, "invalid socket type [" ZEND_LONG_FMT "] specified for argument 2, assuming SOCK_STREAM", arg2);
                arg2 = SOCK_STREAM;
        }
 
@@ -2153,12 +2153,12 @@ PHP_FUNCTION(socket_create_pair)
                && domain != AF_INET6
 #endif
                && domain != AF_UNIX) {
-               php_error_docref(NULL, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", domain);
+               php_error_docref(NULL, E_WARNING, "invalid socket domain [" ZEND_LONG_FMT "] specified for argument 1, assuming AF_INET", domain);
                domain = AF_INET;
        }
 
        if (type > 10) {
-               php_error_docref(NULL, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", type);
+               php_error_docref(NULL, E_WARNING, "invalid socket type [" ZEND_LONG_FMT "] specified for argument 2, assuming SOCK_STREAM", type);
                type = SOCK_STREAM;
        }
 
index 87fb2ae37b3e936c36c3f69ef03b80e9337d8d67..5bbb99f2c51ed5450e0a850dc9b67464a87d9b5a 100644 (file)
@@ -759,7 +759,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
        hash_handle   = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj);
        hash_handlers = SPL_G(hash_mask_handlers);
 
-       return strpprintf(32, "%016lx%016lx", hash_handle, hash_handlers);
+       return strpprintf(32, "%016zx%016zx", hash_handle, hash_handlers);
 }
 /* }}} */
 
index 60cbac572697ead5ca180c976cda09928d94005d..b35049b0bbd77fbf4eb82c14da67e20d7e913630 100644 (file)
@@ -351,7 +351,7 @@ fetch_dim_string:
                }
                return retval;
        case IS_RESOURCE:
-               zend_error(E_NOTICE, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_P(offset)->handle, Z_RES_P(offset)->handle);
+               zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_P(offset)->handle, Z_RES_P(offset)->handle);
                index = Z_RES_P(offset)->handle;
                goto num_index;
        case IS_DOUBLE:
@@ -369,13 +369,13 @@ num_index:
                if ((retval = zend_hash_index_find(ht, index)) == NULL) {
                        switch (type) {
                                case BP_VAR_R:
-                                       zend_error(E_NOTICE, "Undefined offset: %pd", index);
+                                       zend_error(E_NOTICE, "Undefined offset: " ZEND_LONG_FMT, index);
                                case BP_VAR_UNSET:
                                case BP_VAR_IS:
                                        retval = &EG(uninitialized_zval);
                                        break;
                                case BP_VAR_RW:
-                                       zend_error(E_NOTICE, "Undefined offset: %pd", index);
+                                       zend_error(E_NOTICE, "Undefined offset: " ZEND_LONG_FMT, index);
                                case BP_VAR_W: {
                                    zval value;
                                        ZVAL_UNDEF(&value);
@@ -594,7 +594,7 @@ try_again:
 num_index:
                ht = spl_array_get_hash_table(intern);
                if (zend_hash_index_del(ht, index) == FAILURE) {
-                       zend_error(E_NOTICE,"Undefined offset: %pd", index);
+                       zend_error(E_NOTICE,"Undefined offset: " ZEND_LONG_FMT, index);
                }
                break;
        case IS_REFERENCE:
@@ -1373,7 +1373,7 @@ SPL_METHOD(Array, seek)
                        return; /* ok */
                }
        }
-       zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position %pd is out of range", opos);
+       zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position " ZEND_LONG_FMT " is out of range", opos);
 } /* }}} */
 
 int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count) /* {{{ */
@@ -1826,7 +1826,7 @@ SPL_METHOD(Array, unserialize)
 
 outexcept:
        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
-       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset " ZEND_LONG_FMT " of %zd bytes", (zend_long)((char*)p - buf), buf_len);
        return;
 
 } /* }}} */
index fdae9660236edc202faa0f0a2252bbced40d48e4..1a0a1a35408c69a405ea29ba3f53b43728d83dc2 100644 (file)
@@ -834,7 +834,7 @@ SPL_METHOD(DirectoryIterator, seek)
                        zval_ptr_dtor(&retval);
                }
                if (!valid) {
-                       zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position %ld is out of range", pos);
+                       zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position " ZEND_LONG_FMT " is out of range", pos);
                        return;
                }
                zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_next, "next", NULL);
@@ -2322,7 +2322,7 @@ SPL_METHOD(SplTempFileObject, __construct)
                intern->file_name = "php://memory";
                intern->file_name_len = 12;
        } else if (ZEND_NUM_ARGS()) {
-               intern->file_name_len = slprintf(tmp_fname, sizeof(tmp_fname), "php://temp/maxmemory:%pd", max_memory);
+               intern->file_name_len = slprintf(tmp_fname, sizeof(tmp_fname), "php://temp/maxmemory:" ZEND_LONG_FMT, max_memory);
                intern->file_name = tmp_fname;
        } else {
                intern->file_name = "php://temp";
@@ -2966,7 +2966,7 @@ SPL_METHOD(SplFileObject, seek)
        }
 
        if (line_pos < 0) {
-               zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't seek file %s to negative line %pd", intern->file_name, line_pos);
+               zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't seek file %s to negative line " ZEND_LONG_FMT, intern->file_name, line_pos);
                RETURN_FALSE;
        }
 
index 1675c7eaf3a1d5b0a960512c7dd751a2f1d65a09..7662493cfea9e94cf9607149344bdd9c5d31c3ea 100644 (file)
@@ -1223,7 +1223,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
 
 error:
        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
-       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %zd of %zd bytes", ((char*)p - buf), buf_len);
        return;
 
 } /* }}} */
index 6a0049733fa6687e2d9190caee0eea28bd657bad..537ea0098b9fc90d52fc26034f02d83e351a77f9 100644 (file)
@@ -1550,7 +1550,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
                                return NULL;
                        }
                        if (mode < 0 || mode >= REGIT_MODE_MAX) {
-                               zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode);
+                               zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode " ZEND_LONG_FMT, mode);
                                return NULL;
                        }
                        intern->u.regex.mode = mode;
@@ -2156,7 +2156,7 @@ SPL_METHOD(RegexIterator, setMode)
        }
 
        if (mode < 0 || mode >= REGIT_MODE_MAX) {
-               zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode);
+               zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode " ZEND_LONG_FMT, mode);
                return;/* NULL */
        }
 
@@ -2494,11 +2494,11 @@ static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos)
 
        spl_dual_it_free(intern);
        if (pos < intern->u.limit.offset) {
-               zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset);
+               zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to " ZEND_LONG_FMT " which is below the offset " ZEND_LONG_FMT, pos, intern->u.limit.offset);
                return;
        }
        if (pos >= intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
-               zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count);
+               zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to " ZEND_LONG_FMT " which is behind offset " ZEND_LONG_FMT " plus count " ZEND_LONG_FMT, pos, intern->u.limit.offset, intern->u.limit.count);
                return;
        }
        if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator)) {
@@ -2925,7 +2925,7 @@ SPL_METHOD(CachingIterator, getCache)
        SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
 
        if (!(intern->u.caching.flags & CIT_FULL_CACHE))        {
-               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(getThis())->name));
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(getThis())->name));
                return;
        }
 
@@ -2995,7 +2995,7 @@ SPL_METHOD(CachingIterator, count)
        SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
 
        if (!(intern->u.caching.flags & CIT_FULL_CACHE))        {
-               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(getThis())->name));
+               zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(getThis())->name));
                return;
        }
 
index 223e252e630ab176db1e134339563b542ff9cddb..2f95ecc7b9135b99f1d095fc655e21e96110db4a 100644 (file)
@@ -865,7 +865,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
 
 outexcept:
        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
-       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %zd of %zd bytes", ((char*)p - buf), buf_len);
        return;
 
 } /* }}} */
index 40c093eff3ecc27d36658bb2a4469434b7f076ae..4dba1a15f34ef5b47bc6c4c4a2eea12f0611f46c 100644 (file)
@@ -2119,7 +2119,7 @@ PHP_FUNCTION(array_fill_keys)
 #define RANGE_CHECK_LONG_INIT_ARRAY(start, end) do { \
                zend_ulong __calc_size = (start - end) / lstep; \
                if (__calc_size >= HT_MAX_SIZE - 1) { \
-                       php_error_docref(NULL, E_WARNING, "The supplied range exceeds the maximum array size: start=%pd end=%pd", end, start); \
+                       php_error_docref(NULL, E_WARNING, "The supplied range exceeds the maximum array size: start=" ZEND_LONG_FMT " end=" ZEND_LONG_FMT, end, start); \
                        RETURN_FALSE; \
                } \
                size = (uint32_t)(__calc_size + 1); \
index 016c90e02e72baba3fb2364c8b4394535ef6c5f1..f66e343f981c3b022759cc8e426d22a0a7f0cee0 100644 (file)
@@ -370,7 +370,7 @@ PHP_FUNCTION(assert_options)
                break;
 
        default:
-               php_error_docref(NULL, E_WARNING, "Unknown value %pd", what);
+               php_error_docref(NULL, E_WARNING, "Unknown value " ZEND_LONG_FMT, what);
                break;
        }
 
index 810dc1802603fa019d76312371288102bf14f27b..34ba7431f5ac39bbc8b4fcf75ce604cbbb79c542 100644 (file)
@@ -278,7 +278,7 @@ PHP_FUNCTION(closedir)
        FETCH_DIRP();
 
        if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
-               php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+               php_error_docref(NULL, E_WARNING, "%d is not a valid Directory resource", dirp->res->handle);
                RETURN_FALSE;
        }
 
@@ -394,7 +394,7 @@ PHP_FUNCTION(rewinddir)
        FETCH_DIRP();
 
        if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
-               php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+               php_error_docref(NULL, E_WARNING, "%d is not a valid Directory resource", dirp->res->handle);
                RETURN_FALSE;
        }
 
@@ -413,7 +413,7 @@ PHP_NAMED_FUNCTION(php_if_readdir)
        FETCH_DIRP();
 
        if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
-               php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+               php_error_docref(NULL, E_WARNING, "%d is not a valid Directory resource", dirp->res->handle);
                RETURN_FALSE;
        }
 
index eef1287b0f873d772b6678179bc8a9c3f1903e48..dcd13fa9a3a27aeb8a0224526f18f7305518597b 100644 (file)
@@ -555,7 +555,7 @@ PHP_FUNCTION(file_get_contents)
        }
 
        if (maxlen > INT_MAX) {
-               php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
+               php_error_docref(NULL, E_WARNING, "maxlen truncated from " ZEND_LONG_FMT " to %d bytes", maxlen, INT_MAX);
                maxlen = INT_MAX;
        }
        if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) {
@@ -897,7 +897,7 @@ PHPAPI PHP_FUNCTION(fclose)
        PHP_STREAM_TO_ZVAL(stream, res);
 
        if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
-               php_error_docref(NULL, E_WARNING, "%pd is not a valid stream resource", stream->res->handle);
+               php_error_docref(NULL, E_WARNING, "%d is not a valid stream resource", stream->res->handle);
                RETURN_FALSE;
        }
 
index 502de05cb2657b4be8c0ebe1e4514a4afc2f505f..39034bc685e79eef50dbc3b70fbcc1638de523f8 100644 (file)
@@ -87,7 +87,7 @@ php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add,
        m_width = MAX(min_width, copy_len);
 
        if(m_width > INT_MAX - *pos - 1) {
-               zend_error_noreturn(E_ERROR, "Field width %d is too long", m_width);
+               zend_error_noreturn(E_ERROR, "Field width %zd is too long", m_width);
        }
 
        req_size = *pos + m_width + 1;
index e59c04fc34bba9d074d19c749fd428cbf411f92c..c85a506d973fcd5e8c863149e08cbe8169d411b3 100644 (file)
@@ -531,10 +531,10 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
                        (tmpzval = php_stream_context_get_option(context, "ftp", "resume_pos")) != NULL &&
                        Z_TYPE_P(tmpzval) == IS_LONG &&
                        Z_LVAL_P(tmpzval) > 0) {
-                       php_stream_printf(stream, "REST %pd\r\n", Z_LVAL_P(tmpzval));
+                       php_stream_printf(stream, "REST " ZEND_LONG_FMT "\r\n", Z_LVAL_P(tmpzval));
                        result = GET_FTP_RESULT(stream);
                        if (result < 300 || result > 399) {
-                               php_stream_wrapper_log_error(wrapper, options, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval));
+                               php_stream_wrapper_log_error(wrapper, options, "Unable to resume from offset " ZEND_LONG_FMT, Z_LVAL_P(tmpzval));
                                goto errexit;
                        }
                }
index 528aff3c95a1d41304b0dc864862ce414144c3f6..4d173e57a1307a4fa9d64bbb1b7898907ac1dee2 100644 (file)
@@ -110,7 +110,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
                                char *ekey;
                                size_t ekey_len;
                                /* Is an integer key */
-                               ekey_len = spprintf(&ekey, 0, "%pd", idx);
+                               ekey_len = spprintf(&ekey, 0, ZEND_LONG_FMT, idx);
                                newprefix_len = key_prefix_len + num_prefix_len + ekey_len + key_suffix_len + 3 /* %5B */;
                                newprefix = emalloc(newprefix_len + 1);
                                p = newprefix;
index 02b580fa2897f59f0d49107c344414d4070385c6..fd996d1763f47775e7ee0084d3856003f27949d7 100644 (file)
@@ -629,7 +629,7 @@ finish:
                                (tmpzval = php_stream_context_get_option(context, "http", "content")) != NULL &&
                                Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval) > 0
                ) {
-                       scratch_len = slprintf(scratch, scratch_len, "Content-Length: %d\r\n", Z_STRLEN_P(tmpzval));
+                       scratch_len = slprintf(scratch, scratch_len, "Content-Length: %zd\r\n", Z_STRLEN_P(tmpzval));
                        php_stream_write(stream, scratch, scratch_len);
                        have_header |= HTTP_HEADER_CONTENT_LENGTH;
                }
@@ -644,7 +644,7 @@ finish:
                (tmpzval = php_stream_context_get_option(context, "http", "content")) != NULL &&
                Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval) > 0) {
                if (!(have_header & HTTP_HEADER_CONTENT_LENGTH)) {
-                       scratch_len = slprintf(scratch, scratch_len, "Content-Length: %d\r\n", Z_STRLEN_P(tmpzval));
+                       scratch_len = slprintf(scratch, scratch_len, "Content-Length: %zd\r\n", Z_STRLEN_P(tmpzval));
                        php_stream_write(stream, scratch, scratch_len);
                }
                if (!(have_header & HTTP_HEADER_TYPE)) {
index 688ae9f6d1fe8945a2fe1fc9d41cf264dd0dac4d..0a408d0adc6fc50c6f7e5ee955b176840ec62d56 100644 (file)
@@ -1249,11 +1249,11 @@ PHP_FUNCTION(base_convert)
        convert_to_string_ex(number);
 
        if (frombase < 2 || frombase > 36) {
-               php_error_docref(NULL, E_WARNING, "Invalid `from base' (%pd)", frombase);
+               php_error_docref(NULL, E_WARNING, "Invalid `from base' (" ZEND_LONG_FMT ")", frombase);
                RETURN_FALSE;
        }
        if (tobase < 2 || tobase > 36) {
-               php_error_docref(NULL, E_WARNING, "Invalid `to base' (%pd)", tobase);
+               php_error_docref(NULL, E_WARNING, "Invalid `to base' (" ZEND_LONG_FMT ")", tobase);
                RETURN_FALSE;
        }
 
index f235fee967fa8c6393164d409b865b52773f3c1c..e443ec64a65809a307577fa87c80c881e563aeb0 100644 (file)
@@ -544,7 +544,7 @@ PHP_FUNCTION(proc_open)
 #else
                        descriptors[ndesc].childend = dup(fd);
                        if (descriptors[ndesc].childend < 0) {
-                               php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno));
+                               php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor " ZEND_ULONG_FMT " - %s", nindex, strerror(errno));
                                goto exit_fail;
                        }
 #endif
index 0e5d0ce79e5b5d16f44704f984f52f7ea952565d..a8bedab098d3f971828ade1c3c36da55390cdef8 100644 (file)
@@ -438,13 +438,13 @@ PHP_FUNCTION(stream_get_contents)
 
                if (seek_res != 0) {
                        php_error_docref(NULL, E_WARNING,
-                               "Failed to seek to position %pd in the stream", desiredpos);
+                               "Failed to seek to position " ZEND_LONG_FMT " in the stream", desiredpos);
                        RETURN_FALSE;
                }
        }
 
        if (maxlen > INT_MAX) {
-               php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
+               php_error_docref(NULL, E_WARNING, "maxlen truncated from " ZEND_LONG_FMT " to %d bytes", maxlen, INT_MAX);
                maxlen = INT_MAX;
        }
        if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) {
index 16b9fffba1109d3c5f50485ec03025b4835e940e..efd5119fedcce02a02f4ab1419248e0116ce995f 100644 (file)
@@ -171,7 +171,7 @@ again:
                        break;
                case IS_RESOURCE: {
                        const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc));
-                       php_printf("%sresource(%pd) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown");
+                       php_printf("%sresource(%d) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown");
                        break;
                }
                case IS_REFERENCE:
index 3fc074dd6ae2c1e7f0babb0f6bea42b4f0505747..e2b95174d7058f5d9b4a0a2dd67e28b33ea1e597 100644 (file)
@@ -411,7 +411,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
        (*p) += 2;
 
        if (datalen < 0 || (max - (*p)) <= datalen) {
-               zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - (*p)));
+               zend_error(E_WARNING, "Insufficient data for unserializing - " ZEND_LONG_FMT " required, " ZEND_LONG_FMT " present", datalen, (zend_long)(max - (*p)));
                return 0;
        }
 
index 81cc26db9d11a29211ce56720fdf47e1b881edb1..52e2cf36464fc4c7c9a7c87883580f6cd520221d 100644 (file)
@@ -415,7 +415,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
        (*p) += 2;
 
        if (datalen < 0 || (max - (*p)) <= datalen) {
-               zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - (*p)));
+               zend_error(E_WARNING, "Insufficient data for unserializing - " ZEND_LONG_FMT " required, " ZEND_LONG_FMT " present", datalen, (zend_long)(max - (*p)));
                return 0;
        }
 
index b291daed03ee2339361df6b8cd4d9f5eb4c76387..c4ebc4880084379ab488a957f2408590c7d002a8 100644 (file)
@@ -268,7 +268,7 @@ PHP_FUNCTION(msg_get_queue)
                /* doesn't already exist; create it */
                mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms);
                if (mq->id < 0) {
-                       php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+                       php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno));
                        efree(mq);
                        RETURN_FALSE;
                }
@@ -435,7 +435,7 @@ PHP_FUNCTION(msg_send)
                                break;
 
                        case IS_LONG:
-                               message_len = spprintf(&p, 0, "%pd", Z_LVAL_P(message));
+                               message_len = spprintf(&p, 0, ZEND_LONG_FMT, Z_LVAL_P(message));
                                break;
                        case IS_FALSE:
                                message_len = spprintf(&p, 0, "0");
index e28e6b4c1b7321eb0b3fcd24d9b5a588075fe301..923f7c385387a0200cddb3d7f2f0a5ad142f29c3 100644 (file)
@@ -206,7 +206,7 @@ PHP_FUNCTION(sem_get)
 
        semid = semget(key, 3, perm|IPC_CREAT);
        if (semid == -1) {
-               php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+               php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno));
                RETURN_FALSE;
        }
 
@@ -238,7 +238,7 @@ PHP_FUNCTION(sem_get)
        sop[2].sem_flg = SEM_UNDO;
        while (semop(semid, sop, 3) == -1) {
                if (errno != EINTR) {
-                       php_error_docref(NULL, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
+                       php_error_docref(NULL, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno));
                        break;
                }
        }
@@ -246,7 +246,7 @@ PHP_FUNCTION(sem_get)
        /* Get the usage count. */
        count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
        if (count == -1) {
-               php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+               php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno));
        }
 
        /* If we are the only user, then take this opportunity to set the max. */
@@ -257,7 +257,7 @@ PHP_FUNCTION(sem_get)
                union semun semarg;
                semarg.val = max_acquire;
                if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
-                       php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+                       php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno));
                }
 #elif defined(SETVAL_WANTS_PTR)
                /* This is correct for Solaris 2.6 which does not have union semun. */
@@ -279,7 +279,7 @@ PHP_FUNCTION(sem_get)
        sop[0].sem_flg = SEM_UNDO;
        while (semop(semid, sop, 1) == -1) {
                if (errno != EINTR) {
-                       php_error_docref(NULL, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
+                       php_error_docref(NULL, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x" ZEND_XLONG_FMT ": %s", key, strerror(errno));
                        break;
                }
        }
@@ -319,7 +319,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
        }
 
        if (!acquire && sem_ptr->count == 0) {
-               php_error_docref(NULL, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key);
+               php_error_docref(NULL, E_WARNING, "SysV semaphore " ZEND_LONG_FMT " (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key);
                RETURN_FALSE;
        }
 
@@ -388,7 +388,7 @@ PHP_FUNCTION(sem_remove)
 #else
        if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) {
 #endif
-               php_error_docref(NULL, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_P(arg_id));
+               php_error_docref(NULL, E_WARNING, "SysV semaphore " ZEND_LONG_FMT " does not (any longer) exist", Z_LVAL_P(arg_id));
                RETURN_FALSE;
        }
 
@@ -397,7 +397,7 @@ PHP_FUNCTION(sem_remove)
 #else
        if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
 #endif
-               php_error_docref(NULL, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_P(arg_id), strerror(errno));
+               php_error_docref(NULL, E_WARNING, "failed for SysV sempphore " ZEND_LONG_FMT ": %s", Z_LVAL_P(arg_id), strerror(errno));
                RETURN_FALSE;
        }
 
index 2ecb19dd0fdcbb68f6b44dfada052a84a8b1c69e..55381dbbed258739d0fea1367c107daece234658 100644 (file)
@@ -170,19 +170,19 @@ PHP_FUNCTION(shm_attach)
        /* get the id from a specified key or create new shared memory */
        if ((shm_id = shmget(shm_key, 0, 0)) < 0) {
                if (shm_size < sizeof(sysvshm_chunk_head)) {
-                       php_error_docref(NULL, E_WARNING, "failed for key 0x%px: memorysize too small", shm_key);
+                       php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": memorysize too small", shm_key);
                        efree(shm_list_ptr);
                        RETURN_FALSE;
                }
                if ((shm_id = shmget(shm_key, shm_size, shm_flag | IPC_CREAT | IPC_EXCL)) < 0) {
-                       php_error_docref(NULL, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
+                       php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": %s", shm_key, strerror(errno));
                        efree(shm_list_ptr);
                        RETURN_FALSE;
                }
        }
 
        if ((shm_ptr = shmat(shm_id, NULL, 0)) == (void *) -1) {
-               php_error_docref(NULL, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
+               php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_LONG_FMT ": %s", shm_key, strerror(errno));
                efree(shm_list_ptr);
                RETURN_FALSE;
        }
@@ -233,7 +233,7 @@ PHP_FUNCTION(shm_remove)
        SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
 
        if (shmctl(shm_list_ptr->id, IPC_RMID, NULL) < 0) {
-               php_error_docref(NULL, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, Z_LVAL_P(shm_id), strerror(errno));
+               php_error_docref(NULL, E_WARNING, "failed for key 0x%x, id " ZEND_LONG_FMT ": %s", shm_list_ptr->key, Z_LVAL_P(shm_id), strerror(errno));
                RETURN_FALSE;
        }
 
@@ -303,7 +303,7 @@ PHP_FUNCTION(shm_get_var)
        shm_varpos = php_check_shm_data((shm_list_ptr->ptr), shm_key);
 
        if (shm_varpos < 0) {
-               php_error_docref(NULL, E_WARNING, "variable key %pd doesn't exist", shm_key);
+               php_error_docref(NULL, E_WARNING, "variable key " ZEND_LONG_FMT " doesn't exist", shm_key);
                RETURN_FALSE;
        }
        shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos);
@@ -350,7 +350,7 @@ PHP_FUNCTION(shm_remove_var)
        shm_varpos = php_check_shm_data((shm_list_ptr->ptr), shm_key);
 
        if (shm_varpos < 0) {
-               php_error_docref(NULL, E_WARNING, "variable key %pd doesn't exist", shm_key);
+               php_error_docref(NULL, E_WARNING, "variable key " ZEND_LONG_FMT " doesn't exist", shm_key);
                RETURN_FALSE;
        }
        php_remove_shm_data((shm_list_ptr->ptr), shm_varpos);
index b5dcee8f0d10be0f7677f06b8fa8a3e0b867ef2a..f42cdf0c164f37a89108ac86d60a903c2ac87f6a 100644 (file)
@@ -576,7 +576,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
                                                                char *num_str = NULL;
 
                                                                if (vtype != xmlrpc_vector_array) {
-                                                                       spprintf(&num_str, 0, "%ld", num_index);
+                                                                       spprintf(&num_str, 0, ZEND_LONG_FMT, num_index);
                                                                }
 
                                                                XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(num_str, pIter, depth++));
index df088822425cc65b364774359fb10c4f2d0194ea..73f31bbcd84745c2b8d8ee543853e5c7738007b6 100644 (file)
@@ -1694,7 +1694,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
 
                                if (add_path) {
                                        if ((add_path_len + file_stripped_len) > MAXPATHLEN) {
-                                               php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %pd given)",
+                                               php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %zd given)",
                                                MAXPATHLEN - 1, (add_path_len + file_stripped_len));
                                                zval_ptr_dtor(return_value);
                                                RETURN_FALSE;
index d9d6be16383cdcc1b2f0101a7e9e07c1d3c6e2ef..af54d771811e691192caedf1fb045c72bfce5d86 100644 (file)
@@ -673,7 +673,7 @@ static PHP_FUNCTION(name) \
                } \
        } \
        if (level < -1 || level > 9) { \
-               php_error_docref(NULL, E_WARNING, "compression level (%pd) must be within -1..9", level); \
+               php_error_docref(NULL, E_WARNING, "compression level (" ZEND_LONG_FMT ") must be within -1..9", level); \
                RETURN_FALSE; \
        } \
        switch (encoding) { \
@@ -702,7 +702,7 @@ static PHP_FUNCTION(name) \
                return; \
        } \
        if (max_len < 0) { \
-               php_error_docref(NULL, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
+               php_error_docref(NULL, E_WARNING, "length (" ZEND_LONG_FMT ") must be greater or equal zero", max_len); \
                RETURN_FALSE; \
        } \
        if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len)) { \
@@ -863,7 +863,7 @@ PHP_FUNCTION(inflate_init)
                window = zval_get_long(option_buffer);
        }
        if (window < 8 || window > 15) {
-               php_error_docref(NULL, E_WARNING, "zlib window size (lograithm) (%pd) must be within 8..15", window);
+               php_error_docref(NULL, E_WARNING, "zlib window size (lograithm) (" ZEND_LONG_FMT ") must be within 8..15", window);
                RETURN_FALSE;
        }
 
@@ -1033,7 +1033,7 @@ PHP_FUNCTION(deflate_init)
                level = zval_get_long(option_buffer);
        }
        if (level < -1 || level > 9) {
-               php_error_docref(NULL, E_WARNING, "compression level (%pd) must be within -1..9", level);
+               php_error_docref(NULL, E_WARNING, "compression level (" ZEND_LONG_FMT ") must be within -1..9", level);
                RETURN_FALSE;
        }
 
@@ -1041,7 +1041,7 @@ PHP_FUNCTION(deflate_init)
                memory = zval_get_long(option_buffer);
        }
        if (memory < 1 || memory > 9) {
-               php_error_docref(NULL, E_WARNING, "compression memory level (%pd) must be within 1..9", memory);
+               php_error_docref(NULL, E_WARNING, "compression memory level (" ZEND_LONG_FMT ") must be within 1..9", memory);
                RETURN_FALSE;
        }
 
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(deflate_init)
                window = zval_get_long(option_buffer);
        }
        if (window < 8 || window > 15) {
-               php_error_docref(NULL, E_WARNING, "zlib window size (logarithm) (%pd) must be within 8..15", window);
+               php_error_docref(NULL, E_WARNING, "zlib window size (logarithm) (" ZEND_LONG_FMT ") must be within 8..15", window);
                RETURN_FALSE;
        }
 
index 8313b5bb1d1a86a2d9d78cd7e82c83210fdce313..e1c8c22e6d170cd89e2464d2040511aa58e97627 100644 (file)
@@ -333,7 +333,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
                                /* log-2 base of history window (9 - 15) */
                                zend_long tmp = zval_get_long(tmpzval);
                                if (tmp < -MAX_WBITS || tmp > MAX_WBITS + 32) {
-                                       php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (%pd)", tmp);
+                                       php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (" ZEND_LONG_FMT ")", tmp);
                                } else {
                                        windowBits = tmp;
                                }
@@ -365,7 +365,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
                                                /* Memory Level (1 - 9) */
                                                tmp = zval_get_long(tmpzval);
                                                if (tmp < 1 || tmp > MAX_MEM_LEVEL) {
-                                                       php_error_docref(NULL, E_WARNING, "Invalid parameter give for memory level. (%pd)", tmp);
+                                                       php_error_docref(NULL, E_WARNING, "Invalid parameter give for memory level. (" ZEND_LONG_FMT ")", tmp);
                                                } else {
                                                        memLevel = tmp;
                                                }
@@ -375,7 +375,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
                                                /* log-2 base of history window (9 - 15) */
                                                tmp = zval_get_long(tmpzval);
                                                if (tmp < -MAX_WBITS || tmp > MAX_WBITS + 16) {
-                                                       php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (%pd)", tmp);
+                                                       php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (" ZEND_LONG_FMT ")", tmp);
                                                } else {
                                                        windowBits = tmp;
                                                }
@@ -395,7 +395,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
 factory_setlevel:
                                        /* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */
                                        if (tmp < -1 || tmp > 9) {
-                                               php_error_docref(NULL, E_WARNING, "Invalid compression level specified. (%pd)", tmp);
+                                               php_error_docref(NULL, E_WARNING, "Invalid compression level specified. (" ZEND_LONG_FMT ")", tmp);
                                        } else {
                                                level = tmp;
                                        }
index 496bbfbd129efe6ab4cae5876501da731d2ace64..31b8bea9a70776285d00895fb7703eeb2e2b62a0 100644 (file)
@@ -262,7 +262,7 @@ SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen)
 SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
 {
        if ((SG(post_max_size) > 0) && (SG(request_info).content_length > SG(post_max_size))) {
-               php_error_docref(NULL, E_WARNING, "POST Content-Length of %pd bytes exceeds the limit of %pd bytes",
+               php_error_docref(NULL, E_WARNING, "POST Content-Length of " ZEND_LONG_FMT " bytes exceeds the limit of " ZEND_LONG_FMT " bytes",
                                        SG(request_info).content_length, SG(post_max_size));
                return;
        }
index 30290b6188e577afd15fdb10e29677a1f9f39e41..d9163729a5b117bc2350f03104ab9d751c265ac4 100644 (file)
@@ -232,7 +232,7 @@ struct _sapi_module_struct {
        zend_stat_t *(*get_stat)(void);
        char *(*getenv)(char *name, size_t name_len);
 
-       void (*sapi_error)(int type, const char *error_msg, ...);
+       void (*sapi_error)(int type, const char *error_msg, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 
        int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers);
        int (*send_headers)(sapi_headers_struct *sapi_headers);
index c45a4e48357e26117149f89bf257196609a12325..4e96d9195c313b74421b16daf6b0d9703395f27a 100644 (file)
@@ -104,7 +104,7 @@ const char *fcgi_get_last_client_ip();
 void fcgi_set_in_shutdown(int new_value);
 
 #ifndef HAVE_ATTRIBUTE_WEAK
-typedef void (*fcgi_logger)(int type, const char *fmt, ...);
+typedef void (*fcgi_logger)(int type, const char *fmt, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 void fcgi_set_logger(fcgi_logger lg);
 #endif
 
index dd48242c913b9a25c5ed17e3cef8fe2fc6dc0f12..83f5c1a6b98653bdb839445b5fd2f760fc168cfb 100644 (file)
@@ -1124,7 +1124,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
 
                if (PG(display_errors) && ((module_initialized && !PG(during_request_startup)) || (PG(display_startup_errors)))) {
                        if (PG(xmlrpc_errors)) {
-                               php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%pd</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno);
+                               php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>" ZEND_LONG_FMT "</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno);
                        } else {
                                char *prepend_string = INI_STR("error_prepend_string");
                                char *append_string = INI_STR("error_append_string");
@@ -1468,7 +1468,7 @@ static ZEND_COLD void php_message_handler_for_zend(zend_long message, const void
                                if (message==ZMSG_MEMORY_LEAK_DETECTED) {
                                        zend_leak_info *t = (zend_leak_info *) data;
 
-                                       snprintf(memory_leak_buf, 512, "%s(%d) :  Freeing 0x%.8lX (%zu bytes), script=%s\n", t->filename, t->lineno, (zend_uintptr_t)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated));
+                                       snprintf(memory_leak_buf, 512, "%s(%d) :  Freeing " ZEND_ADDR_FMT " (%zu bytes), script=%s\n", t->filename, t->lineno, (size_t)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated));
                                        if (t->orig_filename) {
                                                char relay_buf[512];
 
index 14e72d91f58dc4de1393c09db87c209eebe573bd..d8d141fdd682854e1a58cde7a2bbb16bf702b085 100644 (file)
@@ -1048,7 +1048,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
                                        cancel_upload = UPLOAD_ERROR_A;
                                } else if (max_file_size && ((zend_long)(total_bytes+blen) > max_file_size)) {
 #if DEBUG_FILE_UPLOAD
-                                       sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of " ZEND_LONG_FMT " bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
+                                       sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %" PRId64 " bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
 #endif
                                        cancel_upload = UPLOAD_ERROR_B;
                                } else if (blen > 0) {
@@ -1066,7 +1066,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
                                                cancel_upload = UPLOAD_ERROR_F;
                                        } else if (wlen < blen) {
 #if DEBUG_FILE_UPLOAD
-                                               sapi_module.sapi_error(E_NOTICE, "Only %d bytes were written, expected to write %d", wlen, blen);
+                                               sapi_module.sapi_error(E_NOTICE, "Only %zd bytes were written, expected to write %zd", wlen, blen);
 #endif
                                                cancel_upload = UPLOAD_ERROR_F;
                                        } else {
@@ -1257,7 +1257,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
                                                }
 #else
                                                {
-                                                       int __len = snprintf(file_size_buf, 65, "%lld", total_bytes);
+                                                       int __len = snprintf(file_size_buf, 65, "%" PRId64, total_bytes);
                                                        file_size_buf[__len] = '\0';
                                                }
 #endif
index 918cb601525f7ff8efc5aeab5aab8c0e51ad48a6..7bb92ecb19207c63043d6e0ad582b6e3b2c88424 100644 (file)
@@ -78,12 +78,12 @@ typedef enum {
 
 
 BEGIN_EXTERN_C()
-PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...);
+PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
 PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap);
-PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...);
+PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
 PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
 PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap);
-PHPAPI int ap_php_asprintf(char **buf, const char *format, ...);
+PHPAPI int ap_php_asprintf(char **buf, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
 PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf);
 PHPAPI char * php_conv_fp(char format, double num,
index 8dc8ef8980ad42fe1bf5a715fca7a9724dc132e8..fa08a1175243b2926d7af6d940cda8c156cf5bac 100644 (file)
@@ -102,7 +102,7 @@ retry:
                        } while (err == EINTR);
                }
                estr = php_socket_strerror(err, NULL, 0);
-               php_error_docref(NULL, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s",
+               php_error_docref(NULL, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%d %s",
                                (zend_long)count, err, estr);
                efree(estr);
        }
index 650f4887522687aa641392e5927ff1e2d76652d6..453fe82998fcf58dcffc65baad593781fa2add42 100644 (file)
@@ -1857,7 +1857,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
                if (!chunk) {
                        goto fail;
                }
-               snprintf(chunk->data.heap.p, chunk->data.heap.len, prologue_template, status, status_string, ZSTR_VAL(escaped_request_uri));
+               snprintf(chunk->data.heap.p, chunk->data.heap.len, prologue_template, status, status_string);
                chunk->data.heap.len = strlen(chunk->data.heap.p);
                php_cli_server_buffer_append(&client->content_sender.buffer, chunk);
        }
index 5aad9a08c9e1738fe118226438f7c28eff031b0e..e04c23699134147a504b9ec5989dd4ca2d084dd6 100644 (file)
@@ -267,13 +267,13 @@ int fpm_log_write(char *log_format) /* {{{ */
                                        /* kilobytes */
                                        } else if (!strcasecmp(format, "kilobytes") || !strcasecmp(format, "kilo")) {
                                                if (!test) {
-                                                       len2 = snprintf(b, FPM_LOG_BUFFER - len, "%lu", proc.memory / 1024);
+                                                       len2 = snprintf(b, FPM_LOG_BUFFER - len, "%zu", proc.memory / 1024);
                                                }
 
                                        /* megabytes */
                                        } else if (!strcasecmp(format, "megabytes") || !strcasecmp(format, "mega")) {
                                                if (!test) {
-                                                       len2 = snprintf(b, FPM_LOG_BUFFER - len, "%lu", proc.memory / 1024 / 1024);
+                                                       len2 = snprintf(b, FPM_LOG_BUFFER - len, "%zu", proc.memory / 1024 / 1024);
                                                }
 
                                        } else {