Re: [linux-audio-dev] [ANN] aubio 0.3.0

From: Paul Brossier <piem@email-addr-hidden>
Date: Sat May 27 2006 - 12:17:47 EEST

On Sat, May 27, 2006 at 07:50:32AM +1000, Erik de Castro Lopo wrote:
> !!!!!!!!
>
> What compiler are you using that didn't call
>
> SF_INFO sfinfo;
> memset (&sfinfo, 0, sfinfo) ;
>
> an error?

err, as Stefan said above, the macro would expand:

         SF_INFO sfinfo;
         memset (&sfinfo, 0, sizeof(sizeof(sfinfo))) ;

which is not wrong but doesn't do what was intended.

> Even without any warnings turned on, gcc-3.3 and gcc-4.0 refuse to
> compile this and give an error "incompatible type for argument 3 of
> `memset'".

No syntax error here. And aubio compiles with -Wall -Werror. :)
I agree with following memset syntax. the applied patch reads:

-#define AUBIO_MEMSET(_dst,_src,_t) memset(_dst,_src,sizeof(_t))
+#define AUBIO_MEMSET(_dst,_src,_t) memset(_dst,_src,_t)

I also removed the sfinfo.format = 0 workaround in sndfile.c and
confirmed the bug was gone. for the record, the error was:

Unable to open input file /path/to/file.wav.
Error. Bad format field in SF_INFO struct when openning a RAW file for read.
Segmentation fault

occuring occasionally when opening multiple files.

bye, Paul
Received on Sat May 27 16:15:01 2006

This archive was generated by hypermail 2.1.8 : Sat May 27 2006 - 16:15:03 EEST