https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237940

            Bug ID: 237940
           Summary: struct nvme_health_information_page{} @
                    /usr/include/dev/nvme/nvme.h has alignment issues.
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: b...@freebsd.org
          Reporter: root+free...@linuxpedia.pl

struct nvme_health_information_page {

        uint8_t                 critical_warning;
        uint16_t                temperature;
        uint8_t                 available_spare;
/* ... */
} __packed __aligned(4);

has issues with alignment: `temperature` field can't be properly aligned on any
current architecture which seems to defeat the `__aligned(4)` hint.

What has bitten me today is that it confuses some code-generating tools, like
Rust's bindgen. I already filed a bug to them, as they treat __packed
__aligned(4) as __packed(4) - which has a *totally* different meaning -  but it
would be nice to have some BSD compiler guru took a glimpse at this particular
structure and shed some light on whether __aligned(4) is OK here. 

And yes, I know this structure layout is not BSD's idea ¯\_(ツ)_/¯

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to