
13 Sep
2005
13 Sep
'05
9:54 p.m.
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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Harrison's Postulate:
For every action, there is an equal and opposite criticism.