mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Introduce zend_error_unchecked()
To be used with custom formats like %H as otherwise the compiler complains about unknown formats
This commit is contained in:
parent
950bb84c7e
commit
d24cf1a417
13
Zend/zend.c
13
Zend/zend.c
@ -489,7 +489,7 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
|
||||
}
|
||||
smart_str_appendc(buf, '\n');
|
||||
}
|
||||
|
||||
|
||||
if (GC_IS_RECURSIVE(Z_OBJ_P(expr))) {
|
||||
smart_str_appends(buf, " *RECURSION*");
|
||||
return;
|
||||
@ -1529,6 +1529,17 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) {
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...) {
|
||||
const char *filename;
|
||||
uint32_t lineno;
|
||||
va_list args;
|
||||
|
||||
get_filename_lineno(type, &filename, &lineno);
|
||||
va_start(args, format);
|
||||
zend_error_va_list(type, filename, lineno, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(
|
||||
int type, const char *filename, uint32_t lineno, const char *format, ...)
|
||||
{
|
||||
|
@ -327,6 +327,8 @@ extern ZEND_API zend_result (*zend_preload_autoload)(zend_string *filename);
|
||||
|
||||
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
/* For custom format specifiers like H */
|
||||
ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...);
|
||||
/* If filename is NULL the default filename is used. */
|
||||
ZEND_API ZEND_COLD void zend_error_at(int type, const char *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
|
||||
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(int type, const char *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
|
||||
|
Loading…
Reference in New Issue
Block a user