[FS#3980] umbim "address-of-packed-member" compilation warning/errors (Attachment added)

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Mon Aug 16 01:24:58 PDT 2021


The following task has a new comment added:

FS#3980 - umbim "address-of-packed-member" compilation warning/errors
User who did this - Kevin 'ldir' Darbyshire-Bryant (ldir)

Taking the address (pointer to) a member of a structure is unpredictable.  There is no guarantee that the type of objects defined in the structure meet architecture alignment rules. ie. there's no guarantee that the 2 signed ints (32 bit) in the string structure are suitably aligned in memory for native cpu access which may require them at 2 or even 4 byte boundaries.

The truly horrible workaround is to pass pointers to a local version of the 'string' structure which is guaranteed to be suitably aligned by the compiler and then copy in/out to final destination in memory.

A suitable patch attached, which compiles for me but is in no way run-time tested.

One or more files have been attached.

More information can be found at the following URL:

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.

More information about the openwrt-bugs mailing list