Page MenuHomeFreeBSD

tunefs: Don't lower WARNS
ClosedPublic

Authored by des on Mar 22 2026, 6:59 PM.
Tags
None
Referenced Files
F156506145: D56033.id174801.diff
Thu, May 14, 5:44 AM
F156488910: D56033.id.diff
Thu, May 14, 1:20 AM
F156488890: D56033.id.diff
Thu, May 14, 1:20 AM
Unknown Object (File)
Tue, May 12, 9:51 AM
Unknown Object (File)
Mon, May 11, 10:16 AM
Unknown Object (File)
Mon, May 11, 10:16 AM
Unknown Object (File)
Sun, May 10, 10:05 AM
Unknown Object (File)
Sun, May 10, 10:01 AM

Details

Summary

Use casts to silence the alignment warnings instead of potentially
suppressing other legitimate warnings.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Mar 22 2026, 6:59 PM

@brooks, @jrtc27: I wonder if it might be nice to have a __ASSUME_ALIGNED wrapper for these cases similar to __DECONST. In particular, for CHERI it can be useful to annotate when pointer values are properly aligned so that assignment can be inlined instead of resulting in a libcall to memcpy.

__ASSUME_ALIGNED could work. __builtin_assume_aligned is broadly supported so I double we even need a fall back.

__ASSUME_ALIGNED could work. __builtin_assume_aligned is broadly supported so I double we even need a fall back.

__ASSUME_ALIGNED currently does not exist, may I commit this until it does?

This revision was not accepted when it landed; it landed in state Needs Review.Apr 2 2026, 11:22 AM
Closed by commit rGc5e79c7e93dd: tunefs: Don't lower WARNS (authored by des). · Explain Why
This revision was automatically updated to reflect the committed changes.
In D56033#1284538, @des wrote:

__ASSUME_ALIGNED could work. __builtin_assume_aligned is broadly supported so I double we even need a fall back.

__ASSUME_ALIGNED currently does not exist, may I commit this until it does?

Yes, to be clear, I wasn't objecting at all, just wanting to raise the idea of being more explicit in the future for these cases.