Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change stack_depth_t to size_t on OpenBSD #4575

Merged
merged 2 commits into from
Jan 5, 2025
Merged

Conversation

dspx-plcr
Copy link
Contributor

I'm not sure when OpenBSD made this change, but on OpenBSD 7.6, backtrace returns a size_t. Prior to this change, building pony fails with

/home/despereaux/build/ponyc/src/libponyrt/platform/ponyassert.c:45:25: error: implicit conversion loses i
nteger precision: 'size_t' (aka 'unsigned long') to 'stack_depth_t' (aka 'int') [-Werror,-Wshorten-64-to-3
2]
  stack_depth_t depth = backtrace(addrs, 256);
                ~~~~~   ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** Error 1 in target 'src/libponyrt/CMakeFiles/libponyrt.dir/platform/ponyassert.c.o'
*** Error 1 in . (src/libponyrt/CMakeFiles/libponyrt.dir/build.make:612 'src/libponyrt/CMakeFiles/libponyr
t.dir/platform/ponyassert.c.o': cd...)
*** Error 2 in . (CMakeFiles/Makefile2:371 'src/libponyrt/CMakeFiles/libponyrt.dir/all')
*** Error 2 in /home/despereaux/build/ponyc/build/build_release (Makefile:136 'all': /usr/bin/make -s -f C
MakeFiles/Makefile2 all)
gmake: *** [Makefile:192: build] Error 2

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jan 4, 2025
@SeanTAllen SeanTAllen added the changelog - changed Automatically add "Changed" CHANGELOG entry on merge label Jan 4, 2025
@ponylang-main
Copy link
Contributor

Hi @dspx-plcr,

The changelog - changed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 4575.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@SeanTAllen
Copy link
Member

@dspx-plcr for the release notes on this, can you note that it was a change to support compiling on OpenBSD 7.6 and that earlier versions of OpenBSD might no longer compile (or won't compile depending on what is true).

Thanks.

@dspx-plcr
Copy link
Contributor Author

I took a look at another PR for the release notes, let me know if you were after something a little different.

The backtrace return should silently get promoted from an int to a size_t, so I think compiling will still work, but I have not tested this myself

Copy link
Member

@SeanTAllen SeanTAllen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with the assumption that CI will pass.

@SeanTAllen SeanTAllen merged commit b8c0998 into ponylang:main Jan 5, 2025
22 checks passed
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Jan 5, 2025
@SeanTAllen
Copy link
Member

Thanks @dspx-plcr. A most excellent first contribution.

github-actions bot pushed a commit that referenced this pull request Jan 5, 2025
github-actions bot pushed a commit that referenced this pull request Jan 5, 2025
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - changed Automatically add "Changed" CHANGELOG entry on merge discuss during sync Should be discussed during an upcoming sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants