From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Tue, 13 Sep 2005 16:08:39 -0400 Subject: [U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest() In-Reply-To: <20050913195442.AA471352B8B@atlas.denx.de> References: <20050913195442.AA471352B8B@atlas.denx.de> Message-ID: <432731C7.9060702@smiths-aerospace.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message <43271DD7.1050003@smiths-aerospace.com> you wrote: > >>> #define CFG_MEMTEST_SCRATCH (--end) > > ... > >>I'm not sure you want that, exactly. You are affecting the variable >>"end" as a side effect in a macro which is generally a bad idea. A no >>side effect version would be: >>#define CFG_MEMTEST_SCRATCH (end - 1) > > > That would mean that *end is included in testing, and used as scratch > cell at the same time --> will not work. > > >>You are also making assumptions on the type of end (the variable, that > > > No. Just, that it has the same type as the "dummy" variable > initilaized by CFG_MEMTEST_SCRATCH > > >>#define CFG_MEMTEST_SCRATCH ((void *)end - 1) > > > That would be definitely worse. > > Best regards, > > Wolfgang Denk Ahh, you _did_ intend the side effect. You are being trickier than I gave you credit for. Please disregard my interference... gvb