From: Reinhard Meyer Date: Mon, 30 Aug 2010 11:39:30 +0200 Subject: [U-Boot] [PATCH] display_buffer: fix misaligned buffer In-Reply-To: <4C7B7864.2080607@emk-elektronik.de> References: <1282940584-27957-1-git-send-email-u-boot@emk-elektronik.de> <4C7B7864.2080607@emk-elektronik.de> Message-ID: <4C7B7C52.1040606@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Reinhard Meyer schrieb: >> + uint32_t linebuf[MAX_LINE_LENGTH_BYTES/4 + 1]; >>> uint32_t *uip = (void*)linebuf; >>> uint16_t *usp = (void*)linebuf; >>> uint8_t *ucp = (void*)linebuf; > I personally prefer this above an attribute. Its disputeable but I prefer > to do things with "normal C constructs" where possible. Reading this, after it had been sent, a perfect patch should make the buffer an union: union { uint32_t ui[MAX.../4+1]; uint16_t us[MAX.../2+1]; uint8_t uc[MAX...+1]; } linebuf; Reinhard