Skip to content

Commit b091b66

Browse files
authored
Unbreak tcc build (#866)
The version of tcc in CI merely warned on unrecognized pragmas but newer versions treat them as fatal errors. Upgrade tcc to prevent that from happening again.
1 parent d162c06 commit b091b66

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
pushd /tmp
8484
git clone https://repo.or.cz/tinycc.git
8585
cd tinycc
86-
git checkout 9d2068c6309dc50dfdbbc30a5d6757683d3f884c
86+
git checkout c21576f8a32715ab439690d18184b0e02022bbbd
8787
./configure
8888
make
8989
sudo make install

quickjs-libc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ static void js_set_thread_state(JSRuntime *rt, JSThreadState *ts)
190190
js_std_cmd(/*SetOpaque*/1, rt, ts);
191191
}
192192

193+
#ifdef __GNUC__
193194
#pragma GCC diagnostic push
194195
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
196+
#endif // __GNUC__
195197
static JSValue js_printf_internal(JSContext *ctx,
196198
int argc, JSValue *argv, FILE *fp)
197199
{
@@ -407,7 +409,9 @@ static JSValue js_printf_internal(JSContext *ctx,
407409
dbuf_free(&dbuf);
408410
return JS_EXCEPTION;
409411
}
412+
#ifdef __GNUC__
410413
#pragma GCC diagnostic pop // ignored "-Wformat-nonliteral"
414+
#endif // __GNUC__
411415

412416
uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
413417
{

quickjs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6927,8 +6927,10 @@ static int JS_PRINTF_FORMAT_ATTR(3, 4) JS_ThrowTypeErrorOrFalse(JSContext *ctx,
69276927
}
69286928
}
69296929

6930+
#ifdef __GNUC__
69306931
#pragma GCC diagnostic push
69316932
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
6933+
#endif // __GNUC__
69326934
static JSValue JS_ThrowTypeErrorAtom(JSContext *ctx, const char *fmt, JSAtom atom)
69336935
{
69346936
char buf[ATOM_GET_STR_BUF_SIZE];
@@ -6942,7 +6944,9 @@ static JSValue JS_ThrowSyntaxErrorAtom(JSContext *ctx, const char *fmt, JSAtom a
69426944
JS_AtomGetStr(ctx, buf, sizeof(buf), atom);
69436945
return JS_ThrowSyntaxError(ctx, fmt, buf);
69446946
}
6947+
#ifdef __GNUC__
69456948
#pragma GCC diagnostic pop // ignored "-Wformat-nonliteral"
6949+
#endif // __GNUC__
69466950

69476951
static int JS_ThrowTypeErrorReadOnly(JSContext *ctx, int flags, JSAtom atom)
69486952
{

0 commit comments

Comments
 (0)