mit-pdos / xv6-riscv

Xv6 for RISC-V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to compile using llvm-clang

quantrpeter opened this issue · comments

commented

/home/peter/workspace/xv6-riscv>~/workspace/llvm-project/install/bin/clang --version
clang version 10.0.1 (https://gitee.com/mirrors/llvm-project.git ef32c611aa214dea855364efd7ba451ec5ec3f74)
Target: riscv64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/peter/workspace/llvm-project/install/bin

kernel/proc.c:636:15: error: use of GNU 'missing =' extension in designator [-Werror,-Wgnu-designator]
  [UNUSED]    "unused",
              ^
              =
kernel/proc.c:637:15: error: use of GNU 'missing =' extension in designator [-Werror,-Wgnu-designator]
  [SLEEPING]  "sleep ",
              ^
              =
kernel/proc.c:638:15: error: use of GNU 'missing =' extension in designator [-Werror,-Wgnu-designator]
  [RUNNABLE]  "runble",
              ^
              =
kernel/proc.c:639:15: error: use of GNU 'missing =' extension in designator [-Werror,-Wgnu-designator]
  [RUNNING]   "run   ",
              ^
              =
kernel/proc.c:640:15: error: use of GNU 'missing =' extension in designator [-Werror,-Wgnu-designator]
  [ZOMBIE]    "zombie"
              ^
              =
5 errors generated.

these code has problem:

  static char *states[] = {
  [UNUSED]    "unused",
  [SLEEPING]  "sleep ",
  [RUNNABLE]  "runble",
  [RUNNING]   "run   ",
  [ZOMBIE]    "zombie"
  };