summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/unix/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/unix/main.c b/ports/unix/main.c
index 79d1e88ad..d9ee6eec4 100644
--- a/ports/unix/main.c
+++ b/ports/unix/main.c
@@ -562,7 +562,12 @@ MP_NOINLINE int main_(int argc, char **argv) {
// First entry is empty. We've already added an empty entry to sys.path, so skip it.
++path;
}
- bool path_remaining = *path;
+ // GCC targeting RISC-V 64 reports a warning about `path_remaining` being clobbered by
+ // either setjmp or vfork if that variable it is allocated on the stack. This may
+ // probably be a compiler error as it occurs on a few recent GCC releases (up to 14.1.0)
+ // but LLVM doesn't report any warnings.
+ static bool path_remaining;
+ path_remaining = *path;
while (path_remaining) {
char *path_entry_end = strchr(path, PATHLIST_SEP_CHAR);
if (path_entry_end == NULL) {