Skip to content

Compiling OCaml with llvm15 as the c compiler trigger compiler warning for file interp.c #11759

Closed as not planned
@richard-zhang

Description

@richard-zhang

Trying to compile OCaml with llvm15 where deprecated-non-prototype is enabled by default gives the following error for interp.c file. Could you gives some hints how to fix the warning for interp.c? Or shall we add -Wnodeprecated-non-prototype to c_warnings flags?

Reproduce

  • command:
/opt/homebrew/opt/llvm/bin/clang -c -O2 -fno-strict-aliasing -fwrapv -pthread -g -Wall -Werror -fno-common  -I./runtime  -D_FILE_OFFSET_BITS=64  -DCAMLDLLIMPORT= -DIN_CAML_RUNTIME -I/opt/homebrew/opt/llvm/include -o runtime/interp.b.o runtime/interp.c
  • error:
runtime/interp.c:1037:28: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
      accu = Primitive(*pc)(accu);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions