From: Marek Vasut Date: Tue, 17 Dec 2019 11:00:20 +0100 Subject: [PATCH 1/1] usb: avoid -Werror=address-of-packed-member In-Reply-To: <20191217092754.31710-1-xypron.glpk@gmx.de> References: <20191217092754.31710-1-xypron.glpk@gmx.de> Message-ID: <3c515d67-67f8-e4d0-7937-ef52b7913320@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/17/19 10:27 AM, Heinrich Schuchardt wrote: > With GCC 9.2.1 errors of type -Werror=address-of-packed-member occur when > passing a member of a packed structure to le16_to_cpus() on a big endian > system (e.g. P2041RDB_defconfig). > > Replace le16_to_cpus() by get_unaligned_le16(). Check defined(__BIG_ENDIAN) > to avoid the introduction of unnecessary instructions on little endian > systems as seen on aarch64. I would expect the compiler would optimize such stuff out ? Can we do without the ifdef ? [...]