leanprover / leanprover/lean4

Compilation on FreeBSD fails: error: 'free_sized' is missing exception specification 'throw()'

Open
#14,136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Compilation on FreeBSD 16 which has an updated toolchain fails with these errors:

/wrkdirs/usr/ports/math/lean4/work/lean4-4.31.0/stage0/src/runtime/object.cpp:64:28: error: 'free_sized' is missing exception specification 'throw()'
   64 | __attribute__((weak)) void free_sized(void *ptr, size_t) {
      |                            ^
      |                                                          throw()
/wrkdirs/usr/ports/math/lean4/work/.build/stage0/include/lean/lean.h:475:6: note: previous declaration is here
  475 | void free_sized(void* ptr, size_t);
      |      ^
/wrkdirs/usr/ports/math/lean4/work/lean4-4.31.0/stage0/src/runtime/object.cpp:267:5: error: call to 'free_sized' is ambiguous
  267 |     free_sized(o, sz);
      |     ^~~~~~~~~~
/wrkdirs/usr/ports/math/lean4/work/.build/stage0/include/lean/lean.h:475:6: note: candidate function
  475 | void free_sized(void* ptr, size_t);
      |      ^
/wrkdirs/usr/ports/math/lean4/work/lean4-4.31.0/stage0/src/runtime/object.cpp:64:28: note: candidate function
   64 | __attribute__((weak)) void free_sized(void *ptr, size_t) {
      |                            ^
2 errors generated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the FreeBSD 16 build and inspect stage0/src/runtime/object.cpp alongside the generated stage0/include/lean/lean.h declaration of free_sized. Trace why the declaration and definition differ under the updated toolchain, then verify that the stage0 compilation completes without the ambiguity or exception-specification errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
60/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.