@@ -1093,7 +1093,7 @@ static __exception int JS_ToArrayLengthFree(JSContext *ctx, uint32_t *plen,
1093
1093
JSValue val, bool is_array_ctor);
1094
1094
static JSValue JS_EvalObject(JSContext *ctx, JSValue this_obj,
1095
1095
JSValue val, int flags, int scope_idx);
1096
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowInternalError(JSContext *ctx, const char *fmt, ...);
1096
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowInternalError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...);
1097
1097
1098
1098
static __maybe_unused void JS_DumpString(JSRuntime *rt, const JSString *p);
1099
1099
static __maybe_unused void JS_DumpObjectHeader(JSRuntime *rt);
@@ -6882,7 +6882,7 @@ static JSValue JS_ThrowError(JSContext *ctx, JSErrorEnum error_num,
6882
6882
return JS_ThrowError2(ctx, error_num, fmt, ap, add_backtrace);
6883
6883
}
6884
6884
6885
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowPlainError(JSContext *ctx, const char *fmt, ...)
6885
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowPlainError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
6886
6886
{
6887
6887
JSValue val;
6888
6888
va_list ap;
@@ -6893,7 +6893,7 @@ JSValue __attribute__((format(printf, 2, 3))) JS_ThrowPlainError(JSContext *ctx,
6893
6893
return val;
6894
6894
}
6895
6895
6896
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowSyntaxError(JSContext *ctx, const char *fmt, ...)
6896
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowSyntaxError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
6897
6897
{
6898
6898
JSValue val;
6899
6899
va_list ap;
@@ -6904,7 +6904,7 @@ JSValue __attribute__((format(printf, 2, 3))) JS_ThrowSyntaxError(JSContext *ctx
6904
6904
return val;
6905
6905
}
6906
6906
6907
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowTypeError(JSContext *ctx, const char *fmt, ...)
6907
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowTypeError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
6908
6908
{
6909
6909
JSValue val;
6910
6910
va_list ap;
@@ -6915,7 +6915,7 @@ JSValue __attribute__((format(printf, 2, 3))) JS_ThrowTypeError(JSContext *ctx,
6915
6915
return val;
6916
6916
}
6917
6917
6918
- static int __attribute__((format(printf, 3, 4))) JS_ThrowTypeErrorOrFalse(JSContext *ctx, int flags, const char *fmt, ...)
6918
+ static int JS_PRINTF_FORMAT_ATTR( 3, 4) JS_ThrowTypeErrorOrFalse(JSContext *ctx, int flags, JS_PRINTF_FORMAT const char *fmt, ...)
6919
6919
{
6920
6920
va_list ap;
6921
6921
@@ -6931,15 +6931,15 @@ static int __attribute__((format(printf, 3, 4))) JS_ThrowTypeErrorOrFalse(JSCont
6931
6931
}
6932
6932
6933
6933
/* never use it directly */
6934
- static JSValue __attribute__((format(printf, 3, 4))) __JS_ThrowTypeErrorAtom(JSContext *ctx, JSAtom atom, const char *fmt, ...)
6934
+ static JSValue JS_PRINTF_FORMAT_ATTR( 3, 4) __JS_ThrowTypeErrorAtom(JSContext *ctx, JSAtom atom, JS_PRINTF_FORMAT const char *fmt, ...)
6935
6935
{
6936
6936
char buf[ATOM_GET_STR_BUF_SIZE];
6937
6937
return JS_ThrowTypeError(ctx, fmt,
6938
6938
JS_AtomGetStr(ctx, buf, sizeof(buf), atom));
6939
6939
}
6940
6940
6941
6941
/* never use it directly */
6942
- static JSValue __attribute__((format(printf, 3, 4))) __JS_ThrowSyntaxErrorAtom(JSContext *ctx, JSAtom atom, const char *fmt, ...)
6942
+ static JSValue JS_PRINTF_FORMAT_ATTR( 3, 4) __JS_ThrowSyntaxErrorAtom(JSContext *ctx, JSAtom atom, JS_PRINTF_FORMAT const char *fmt, ...)
6943
6943
{
6944
6944
char buf[ATOM_GET_STR_BUF_SIZE];
6945
6945
return JS_ThrowSyntaxError(ctx, fmt,
@@ -6962,7 +6962,7 @@ static int JS_ThrowTypeErrorReadOnly(JSContext *ctx, int flags, JSAtom atom)
6962
6962
}
6963
6963
}
6964
6964
6965
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowReferenceError(JSContext *ctx, const char *fmt, ...)
6965
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowReferenceError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
6966
6966
{
6967
6967
JSValue val;
6968
6968
va_list ap;
@@ -6973,7 +6973,7 @@ JSValue __attribute__((format(printf, 2, 3))) JS_ThrowReferenceError(JSContext *
6973
6973
return val;
6974
6974
}
6975
6975
6976
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowRangeError(JSContext *ctx, const char *fmt, ...)
6976
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowRangeError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
6977
6977
{
6978
6978
JSValue val;
6979
6979
va_list ap;
@@ -6984,7 +6984,7 @@ JSValue __attribute__((format(printf, 2, 3))) JS_ThrowRangeError(JSContext *ctx,
6984
6984
return val;
6985
6985
}
6986
6986
6987
- JSValue __attribute__((format(printf, 2, 3))) JS_ThrowInternalError(JSContext *ctx, const char *fmt, ...)
6987
+ JSValue JS_PRINTF_FORMAT_ATTR( 2, 3) JS_ThrowInternalError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
6988
6988
{
6989
6989
JSValue val;
6990
6990
va_list ap;
@@ -19034,7 +19034,7 @@ static void __attribute((unused)) dump_token(JSParseState *s,
19034
19034
}
19035
19035
}
19036
19036
19037
- int __attribute__((format(printf, 2, 3))) js_parse_error(JSParseState *s, const char *fmt, ...)
19037
+ int JS_PRINTF_FORMAT_ATTR( 2, 3) js_parse_error(JSParseState *s, JS_PRINTF_FORMAT const char *fmt, ...)
19038
19038
{
19039
19039
JSContext *ctx = s->ctx;
19040
19040
va_list ap;
@@ -34647,7 +34647,7 @@ typedef struct BCReaderState {
34647
34647
} BCReaderState;
34648
34648
34649
34649
#ifdef DUMP_READ_OBJECT
34650
- static void __attribute__((format(printf, 2, 3))) bc_read_trace(BCReaderState *s, const char *fmt, ...) {
34650
+ static void JS_PRINTF_FORMAT_ATTR( 2, 3) bc_read_trace(BCReaderState *s, JS_PRINTF_FORMAT const char *fmt, ...) {
34651
34651
va_list ap;
34652
34652
int i, n, n0;
34653
34653
@@ -49924,7 +49924,7 @@ static int isURIReserved(int c) {
49924
49924
return c < 0x100 && memchr(";/?:@&=+$,#", c, sizeof(";/?:@&=+$,#") - 1) != NULL;
49925
49925
}
49926
49926
49927
- static int __attribute__((format(printf, 2, 3))) js_throw_URIError(JSContext *ctx, const char *fmt, ...)
49927
+ static int JS_PRINTF_FORMAT_ATTR( 2, 3) js_throw_URIError(JSContext *ctx, JS_PRINTF_FORMAT const char *fmt, ...)
49928
49928
{
49929
49929
va_list ap;
49930
49930
0 commit comments