« Previous | Next » 

Revision f806d765

ID: f806d765aab07876d073b60ad3cc5d3df321b87f
Added by Eric Blossom almost 5 years ago

Trial fix for ticket:258 / integer overflow undefined / phase
accumulator. Thanks to Stefan Bruens and Philip Ballister for working
on this.

According to the fine print in the C and C++ standards, if a signed
integer type overflows, the result is undefined. As of gcc 4.3, gcc
was proving that our code was overflowing, and took advantage of the
"undefined" result to short circuit the evaluation.

Moral of the story: if you're using a fixed point phase accumulator,
or anything else where you're counting on overflow happening, be sure
that your variable is unsigned.

See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37067 and
http://www.airs.com/blog/archives/120

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9296 221aa14e-8319-0410-a670-987f0aec2ac5

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences