Silence harmless GCC warnings.

This commit is contained in:
Tor Andersson
2021-11-04 12:27:25 +01:00
parent 3bd234c685
commit e7ba87678f
2 changed files with 9 additions and 3 deletions

View File

@@ -98,8 +98,10 @@ static void jsB_isFinite(js_State *J)
js_pushboolean(J, isfinite(n));
}
static void Encode(js_State *J, const char *str, const char *unescaped)
static void Encode(js_State *J, const char *str_, const char *unescaped)
{
/* NOTE: volatile to silence GCC warning about longjmp clobbering a variable */
const char * volatile str = str_;
js_Buffer *sb = NULL;
static const char *HEX = "0123456789ABCDEF";
@@ -126,8 +128,10 @@ static void Encode(js_State *J, const char *str, const char *unescaped)
js_free(J, sb);
}
static void Decode(js_State *J, const char *str, const char *reserved)
static void Decode(js_State *J, const char *str_, const char *reserved)
{
/* NOTE: volatile to silence GCC warning about longjmp clobbering a variable */
const char * volatile str = str_;
js_Buffer *sb = NULL;
int a, b;

4
json.c
View File

@@ -362,7 +362,9 @@ static void JSON_stringify(js_State *J)
{
js_Buffer *sb = NULL;
char buf[12];
const char *s, *gap;
/* NOTE: volatile to silence GCC warning about longjmp clobbering a variable */
const char * volatile gap;
const char *s;
int n;
gap = NULL;