Page MenuHomeFreeBSD

Fix build of liquidio with base gcc on i386
ClosedPublic

Authored by dim on Jun 11 2018, 8:49 AM.
Tags
None
Referenced Files
F140771155: D15754.id43697.diff
Sat, Dec 27, 9:21 PM
Unknown Object (File)
Thu, Dec 4, 4:31 AM
Unknown Object (File)
Sun, Nov 30, 12:37 AM
Unknown Object (File)
Nov 27 2025, 9:36 AM
Unknown Object (File)
Nov 26 2025, 12:17 AM
Unknown Object (File)
Nov 25 2025, 5:58 PM
Unknown Object (File)
Nov 20 2025, 10:50 PM
Unknown Object (File)
Nov 20 2025, 10:49 PM
Subscribers

Details

Summary

Base gcc fails to compile sys/dev/liquidio/lio_main.c for i386, with
the following -Werror warnings:

cc1: warnings being treated as errors
/usr/src/sys/modules/lio/../../dev/liquidio/lio_main.c: In function 'lio_setup_glists':
/usr/src/sys/modules/lio/../../dev/liquidio/lio_main.c:1774: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/modules/lio/../../dev/liquidio/lio_main.c:1775: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

This is because on i386, the casts from uint64_t to a pointer reduce
the values from 64 bit to 32 bit, and vice versa.

For gcc, this can be fixed by intermediate casts to uintptr_t. Note
that I am assuming the incoming values will always fit into 32 bit!

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17164
Build 17016: arc lint + arc unit