Page MenuHomeFreeBSD

fstyp: Remove __packed from struct exfat_de_label.
ClosedPublic

Authored by jhb on Sep 25 2021, 6:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 9:50 PM
Unknown Object (File)
Sun, Mar 31, 12:16 AM
Unknown Object (File)
Sun, Mar 31, 12:16 AM
Unknown Object (File)
Sat, Mar 30, 11:56 PM
Unknown Object (File)
Sat, Mar 30, 11:56 PM
Unknown Object (File)
Sat, Mar 30, 11:43 PM
Unknown Object (File)
Feb 10 2024, 5:10 AM
Unknown Object (File)
Feb 6 2024, 6:28 AM
Subscribers

Details

Summary

This fixes a -Waddress-of-packed-member warning about a possibly
unaligned pointer from GCC 9 when calling convert_label().

__packed has to be removed from struct exfat_dirent as well to fix an
alignment warning when casting from a struct exfat_dirent pointer to a
struct exfat_de_label pointer.

Diff Detail

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

Event Timeline

jhb requested review of this revision.Sep 25 2021, 6:29 PM

Address of packed member? How?

Nothing functionally wrong with the change but I don’t understand the warning here.

usr.sbin/fstyp/exfat.c
224–225

Comment is now stale

This revision is now accepted and ready to land.Sep 25 2021, 6:33 PM
usr.sbin/fstyp/exfat.c
309

The warning is triggered here as the type of the lde structure is packed.

usr.sbin/fstyp/exfat.c
309

Oh. That structure could also just have packed removed.

pstef added a subscriber: pstef.

First of all, sorry about this - I believe I caused this issue by bumping WARNS to default without first testing the change with gcc. I have now installed gcc9 in order to test future changes like this, in the hope that I can avoid making mess like this.

As for the issue at hand, this change looks good to me, but if you want my opinion, I'm in favor of removing the packed attribute from the struct.

  • Remove __packed instead.
This revision now requires review to proceed.Feb 1 2022, 12:57 AM
jhb retitled this revision from fstyp: Use a void pointer for the ucs2label argument to convert_label. to fstyp: Remove __packed from struct exfat_de_label..Feb 1 2022, 1:06 AM
jhb edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Feb 1 2022, 1:12 AM