This ensures this header can be included without an explicit or implicit
sys/types.h include first. This causes issues building SPEC2017 which
includes sys/rtprio.h and then we get an error due to missing u_char
definition.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 67015 Build 63898: arc lint + arc unit
Event Timeline
Comment Actions
Do you need sys/types.h, or sys/_types.h? The latter has less namespace pollution...
And if these are on the excluded list for check headers for buildworld, please remove them.
Comment Actions
They both use u_char and u_short so need the full sys/types.h. Alternatively I guess I could replace them with unsigned char/uint8_t?
Comment Actions
# Ensure no regressions in self-includeability of sys/*.h and net*/*.h test-includes: .PHONY ${_+_}cd ${.CURDIR}/tools/build/test-includes; \ ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} DESTDIR=${WORLDTMP} test-includes
tools/build/test-includes/badfiles.inc has the list. Both of these files are on there.
I've often used the raw spelling for u_char/u_int etc with unsigned char, unsigned int, etc when it's only a few instances. If that works, that is. If there's a lot or other considerations, I just included sys/types.h or sys/_types.h. This looks to be more of a 'replace' than an 'include' scenario, but maybe I'm missing something.