Skip to content

Conversation

xjtuwxg
Copy link

@xjtuwxg xjtuwxg commented Jul 29, 2025

  1. Got the following compilation error on MacOS 15.5 (x86_64-elf-gcc (GCC) 15.1.0). It seems because nullptr becomes a keyword in C++11 and later.
make
rm -f ".depend"
x86_64-elf-gcc -MM bio.c bootmain.c cat.c console.c echo.c exec.c file.c forktest.c fs.c grep.c ide.c init.c ioapic.c kalloc.c kbd.c kill.c lapic.c ln.c log.c ls.c main.c memide.c mkdir.c mkfs.c mp.c pipe.c printf.c proc.c rm.c sh.c sleeplock.c spinlock.c stressfs.c string.c syscall.c sysfile.c sysproc.c trap.c uart.c ulib.c umalloc.c usertests.c vm.c wc.c zombie.c > ".depend"
x86_64-elf-gcc -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -MD -ggdb -fno-omit-frame-pointer -ffreestanding -fno-common -nostdlib -m64 -DX64 -mcmodel=large -mtls-direct-seg-refs -mno-red-zone -O0 -fno-stack-protector   -c -o usertests.o usertests.c
usertests.c:285:1: error: expected identifier or '(' before 'nullptr'
  285 | nullptr(void)
      | ^~~~~~~
usertests.c: In function 'main':
usertests.c:1651:3: error: called object is not a function or function pointer
 1651 |   nullptr();
      |   ^~~~~~~
make: *** [usertests.o] Error 1
  1. It seems that .depend should be added to .gitignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant