Page MenuHomeFreeBSD

tcp_bbr: avoid gcc -Werror=pointer-to-int-cast on 32-bit arch
ClosedPublic

Authored by rlibby on Jun 26 2024, 7:50 PM.
Tags
None
Referenced Files
F98765070: D45751.diff
Fri, Oct 4, 4:08 PM
Unknown Object (File)
Fri, Oct 4, 11:55 AM
Unknown Object (File)
Fri, Oct 4, 7:51 AM
Unknown Object (File)
Wed, Oct 2, 8:39 PM
Unknown Object (File)
Tue, Oct 1, 7:08 PM
Unknown Object (File)
Sat, Sep 21, 1:49 PM
Unknown Object (File)
Fri, Sep 20, 7:15 AM
Unknown Object (File)
Sat, Sep 14, 12:16 AM

Details

Test Plan

make buildkernel on amd64 and i386, examine warnings

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58368
Build 55256: arc lint + arc unit

Event Timeline

rlibby added reviewers: rrs, tuexen.

Why is an uint64_t not good enough to hold a pointer? Aren't pointers 32-bit or 64-bit on all architectures FreeBSD supports?

Why is an uint64_t not good enough to hold a pointer? Aren't pointers 32-bit or 64-bit on all architectures FreeBSD supports?

Yeah, uint64_t is always wide enough. gcc's issue on 32-bit arch is that it doesn't like to see a 32-bit pointer cast directly to a 64-bit integer. It issues -Wpointer-to-int-cast, which is an error with our flags. This patch works around that by first casting to an integer type that is the same width as a pointer. From there there is no complaint about the conversion to uint64_t. The patch is intended to be a functional nop, for both 32-bit and 64-bit arch.

Same deal in D45752. Related issue in reverse in D45750.

This revision is now accepted and ready to land.Jun 26 2024, 8:51 PM