From 5292fdc6ac69ae98eb9f8b009e4ed9a8c25f1a55 Mon Sep 17 00:00:00 2001 From: CGH0S7 <776459475@qq.com> Date: Fri, 23 May 2025 21:47:16 +0800 Subject: [PATCH] gcc-15 bug fixed --- Makefile | 6 +++--- user/usertests.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 74e454f..bb312a0 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ LD = $(TOOLPREFIX)ld OBJCOPY = $(TOOLPREFIX)objcopy OBJDUMP = $(TOOLPREFIX)objdump -CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 +CFLAGS = -Wall -Werror -O1 -fno-omit-frame-pointer -ggdb -gdwarf-2 ifdef LAB LABUPPER = $(shell echo $(LAB) | tr a-z A-Z) @@ -238,10 +238,10 @@ $U/_uthread: $U/uthread.o $U/uthread_switch.o $(ULIB) $(OBJDUMP) -S $U/_uthread > $U/uthread.asm ph: notxv6/ph.c - gcc -o ph -g -O2 $(XCFLAGS) notxv6/ph.c -pthread + gcc -o ph -g -Ofast $(XCFLAGS) notxv6/ph.c -pthread barrier: notxv6/barrier.c - gcc -o barrier -g -O2 $(XCFLAGS) notxv6/barrier.c -pthread + gcc -o barrier -g -Ofast $(XCFLAGS) notxv6/barrier.c -pthread endif ifeq ($(LAB),pgtbl) diff --git a/user/usertests.c b/user/usertests.c index 28b53f9..57809b5 100644 --- a/user/usertests.c +++ b/user/usertests.c @@ -244,7 +244,7 @@ copyinstr3(char *s) // See if the kernel refuses to read/write user memory that the // application doesn't have anymore, because it returned it. void -rwsbrk() +rwsbrk(char* arg) { int fd, n;