Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
> 
> Use the new TRAILING_OVERLAP() helper to fix a dozen instances of
> the following type of warning:
> 
> drivers/acpi/nfit/intel.c:692:35: warning: structure containing a flexible 
> array member is not at the end of another structure 
> [-Wflex-array-member-not-at-end]
> 
> Acked-by: Dan Williams <[email protected]>
> Tested-by: Dan Williams <[email protected]>

Looks like our mails crossed [1], but I rushed this testing, apologies.
This patch does cause a regression, and the conversion is not equivalent
according to pahole:

union pkg_nd_intel_bus_fw_activate {
        struct nd_cmd_pkg          pkg;                /*     0    64 */
        struct {
                u8                 _offset_to_fam[64]; /*     0    64 */
                /* --- cacheline 1 boundary (64 bytes) --- */
                struct nd_intel_bus_fw_activate cmd;   /*    64     5 */
        } __attribute__((__packed__));                 /*     0    69 */
};
struct pkg_nd_intel_bus_fw_activate2 {
        struct nd_cmd_pkg          pkg;                  /*     0    64 */

        /* XXX last struct has a flexible array */

        /* --- cacheline 1 boundary (64 bytes) --- */
        struct nd_intel_bus_fw_activate cmd;             /*    64     5 */

        /* size: 72, cachelines: 2, members: 2 */
        /* padding: 3 */
        /* flexible array members: end: 1 */
        /* last cacheline: 8 bytes */
};

Now, why the padding at the end matters for this test, I am still
trying to figure that out.

[1]: http://lore.kernel.org/[email protected]

Reply via email to