From: Wolfgang Denk Date: Sun, 04 Nov 2012 01:39:22 +0100 Subject: [U-Boot] [PATCH 2/3] md5: Fix gcc-4.7 build problem in md5 In-Reply-To: <20121104003242.92729200056@gemini.denx.de> References: <1351979121-3769-1-git-send-email-sjg@chromium.org> <1351979121-3769-2-git-send-email-sjg@chromium.org> <20121104003242.92729200056@gemini.denx.de> Message-ID: <20121104003923.08BAE200056@gemini.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 Dear Simon, In message <20121104003242.92729200056@gemini.denx.de> I wrote: > > > /* Append length in bits and transform */ > > - ctx->in32[14] = ctx->bits[0]; > > - ctx->in32[15] = ctx->bits[1]; > > + memcpy(ctx->in + 14 * sizeof(__u32), ctx->bits, 2 * sizeof(__u32)); > > This makes the code actually unreadable. Please add at least a > comment what this is doing. Actually I think this shoul dbe split into two memcpy commands, using the addresses of the respective array elements directly, without such manual pointer arithmetics. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "The number of Unix installations has grown to 10, with more expected." - The Unix Programmer's Manual, 2nd Edition, June, 1972