[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in gen5200/tod/pcf8563.c



On 2007-05-11, Wolfram Wadepohl <Wolfram.Wadepohl at ek-automation.com> wrote:
> The macro
> #define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F))
> produces wrong code in pcf8563_get_time().

Without looking at the source, I'd guess the reason is that this is quite
a dangerous macro (it evaluates the _x argument twice). If this macro is
invoked with an argument which directly references a (volatile) register,
it might see two different values when evaluating _x.

Cheers
Ingolf