M
Michael Foukarakis
Hello,
I've been working on a simulation project with a friend for the past
weeks, and we're making extensive use of BCD arithmetic (this is not
directly relevant, unless the discussion takes us there..). Last night
my buddy came up with this somewhere in her code:
while (i--)
*fp++ = *fp >> 4;
and I'm a little confused, because GCC says:
addcycle.c:109: warning: operation on 'fp' may be undefined
but it looks well-defined to me, albeit confusing.
What's your opinions? Can anyone definitively say whether this invokes
undefined behaviour?
Thanks in advance.
I've been working on a simulation project with a friend for the past
weeks, and we're making extensive use of BCD arithmetic (this is not
directly relevant, unless the discussion takes us there..). Last night
my buddy came up with this somewhere in her code:
while (i--)
*fp++ = *fp >> 4;
and I'm a little confused, because GCC says:
addcycle.c:109: warning: operation on 'fp' may be undefined
but it looks well-defined to me, albeit confusing.
What's your opinions? Can anyone definitively say whether this invokes
undefined behaviour?
Thanks in advance.