diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-28 15:31:53 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-28 15:31:53 -0400 |
| commit | ca76fb335ae7b3f820beeeed5667950e7489711e (patch) | |
| tree | e0ef48cce92aeeb92241ef98c65bf3af84c05ca4 /src/compile.c | |
| parent | 4de0fee8f694503b453e04084caaab55f8670b6c (diff) | |
Add compiler guards for GCC directives
Diffstat (limited to 'src/compile.c')
| -rw-r--r-- | src/compile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compile.c b/src/compile.c index a2378202..f9db7849 100644 --- a/src/compile.c +++ b/src/compile.c @@ -2152,10 +2152,14 @@ CORD compile_string_literal(CORD literal) { CORD code = "\""; CORD_pos i; +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" +#endif CORD_FOR(i, literal) { +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif char c = CORD_pos_fetch(i); switch (c) { case '\\': code = CORD_cat(code, "\\\\"); break; @@ -2181,10 +2185,14 @@ CORD compile_string_literal(CORD literal) static bool string_literal_is_all_ascii(CORD literal) { CORD_pos i; +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" +#endif CORD_FOR(i, literal) { +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif if (!isascii(CORD_pos_fetch(i))) return false; } |
