Page MenuHomeFreeBSD

tunefs: Don't lower WARNS
ClosedPublic

Authored by des on Mar 22 2026, 6:59 PM.
Tags
None
Referenced Files
F163312754: D56033.id174131.diff
Wed, Jul 22, 12:07 AM
Unknown Object (File)
Mon, Jul 20, 2:42 PM
Unknown Object (File)
Sat, Jul 18, 4:03 PM
Unknown Object (File)
Wed, Jul 15, 7:14 AM
Unknown Object (File)
Wed, Jul 15, 7:14 AM
Unknown Object (File)
Thu, Jul 2, 2:44 AM
Unknown Object (File)
Sat, Jun 27, 1:41 PM
Unknown Object (File)
Sat, Jun 27, 2:04 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.