-
Notifications
You must be signed in to change notification settings - Fork 177
Fixes to format preprocessing for Clang on Windows #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c7a9a92
2b1f713
51f5332
1607d47
bb6dfe0
6731454
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,8 @@ extern "C" { | |
|
||
/* Borrowed from Folly */ | ||
#ifndef JS_PRINTF_FORMAT | ||
#ifdef _MSC_VER | ||
/* Clang on Windows doesn't seem to support _Printf_format_string_ */ | ||
#if defined(_MSC_VER) && !defined(__clang__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you make this change also in quickjs.h, for consistency? |
||
#include <sal.h> | ||
#define JS_PRINTF_FORMAT _Printf_format_string_ | ||
#define JS_PRINTF_FORMAT_ATTR(format_param, dots_param) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7048,7 +7048,7 @@ static int JS_PRINTF_FORMAT_ATTR(3, 4) JS_ThrowTypeErrorOrFalse(JSContext *ctx, | |
} | ||
} | ||
|
||
#ifdef __GNUC__ | ||
#if defined(__GNUC__) || defined(__clang__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought clang also defined GNUC, doesn't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least locally that seems to not be the case when compiling on Windows, though not sure why |
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
#endif // __GNUC__ | ||
|
@@ -7065,7 +7065,7 @@ static JSValue JS_ThrowSyntaxErrorAtom(JSContext *ctx, const char *fmt, JSAtom a | |
JS_AtomGetStr(ctx, buf, sizeof(buf), atom); | ||
return JS_ThrowSyntaxError(ctx, fmt, buf); | ||
} | ||
#ifdef __GNUC__ | ||
#if defined(__GNUC__) || defined(__clang__) | ||
#pragma GCC diagnostic pop // ignored "-Wformat-nonliteral" | ||
#endif // __GNUC__ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this change also in quickjs.h, for consistency?