vinniefalco / DSPFilters

A Collection of Useful C++ Classes for Digital Signal Processing
1.79k stars 371 forks source link

operator precedence bug + a worry #20

Closed siims closed 7 years ago

siims commented 10 years ago

I am a bit worried about taking this source into my projects. There are two reasons for this: 1) It seems to be not maintained (issue #19 ). 2) I spent an evening getting to understand my way around, but stepped into quite simple bug in Cascade.h:124: _dest++ = state.process (_dest, this); // which read random data in the end of every filter run (I think it is expected to analyze sample dest, not *(dest+1) each round, otherwise samples 1 to back+1 will be used, not 0 to back). This kind of bugs are making me doubt in using this... How has been others' experience?

galchinsky commented 7 years ago

I spent an evening getting to understand my way around,

Oh f... I spent an evening too. I should have read the known issues first... Thank you anyway.

Yes, it is a well known C and C++ feature that modifying variables in one line is undefined behavior (same as infamous i ++ + ++ i question). S it could work on the author's machine while not working on ours.

This kind of bugs are making me doubt in using this... Yes, that's a problem. I'll write an email to the author.

galchinsky commented 7 years ago

I asked to maintain this repo. I don't have much time for this but luckily most the bugs are already fixed in PRs, even several times. I still recommend to use it, I didn't have problem except of that annoying bug of operator precedence.