aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-28 15:31:53 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-28 15:31:53 -0400
commitca76fb335ae7b3f820beeeed5667950e7489711e (patch)
treee0ef48cce92aeeb92241ef98c65bf3af84c05ca4 /src/parse.c
parent4de0fee8f694503b453e04084caaab55f8670b6c (diff)
Add compiler guards for GCC directives
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c
index 71bd49fd..de52f765 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -231,8 +231,10 @@ static PARSER(parse_deserialize);
//
// Convert an escape sequence like \n to a string
//
+#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstack-protector"
+#endif
static const char *unescape(parse_ctx_t *ctx, const char **out) {
const char **endpos = out;
const char *escape = *out;
@@ -292,7 +294,9 @@ static const char *unescape(parse_ctx_t *ctx, const char **out) {
return GC_strndup(escape+1, 1);
}
}
+#ifdef __GNUC__
#pragma GCC diagnostic pop
+#endif
// Indent is in number of spaces (assuming that \t is 4 spaces)
PUREFUNC static INLINE int64_t get_indent(parse_ctx_t *ctx, const char *pos)