Page MenuHomeFreeBSD

build: add stddef.h to define ptraddr_t as required
Needs ReviewPublic

Authored by brooks on Mon, Feb 16, 1:49 PM.

Details

Reviewers
kib
Group Reviewers
cheri
Summary

Effort: CHERI upstreaming
Sponsored by: Innovate UK
Co-authored-by: Alfredo Mazzinghi <am2419@cl.cam.ac.uk>
Co-authored-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70702
Build 67585: arc lint + arc unit

Event Timeline

With this stack of changes it's possible to (cross)build world and kernel with ptraddr_t in a system header.

jrtc27 added inline comments.
tools/build/stddef.h
44

Isn't this wrong for 32-bit? Should we not use PTRADDR_TYPE if available, else fall back on size_t?

Use PTRADDR_TYPE where available

tools/build/stddef.h
44

It should be 32-bit on ILP32 and 64-bit on LP64. It's wrong on LLP64, but I don't think we care. Another alternative would be size_t.

tools/build/stddef.h
44

It's the right size but not the same type, and that affects things like printf format strings. Hence the suggestion to fall back on size_t, which will be unsigned int as expected.