View Single Post
Old 2010-10-30, 16:38   #10
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

20E16 Posts
Default

Hi WraithX,

The problem was that an intended prototype for an internal function in mul_fft.c had a _PROTO(x) guard around it to cope with very old compilers that don't use function prototypes. For MSVC the code defined _PROTO(x) to nothing so there was no function prototype and the parameters in question were hence assumed to be ordinary ints. The corrected code is:
Quote:
#ifndef _PROTO
#if (__STDC__-0) || defined (__cplusplus) || defined( _MSC_VER )
#define _PROTO(x) x
#else
#define _PROTO(x) ()
#endif
#endif
so any compiler that doesn't see the first definition of _PROTO(x) is going to have the same problem.

I wouldn't do it this way - I would identify any compilers that DON'T use prototypes so that the first form becomes the default rather than the second (obsolete) form.

In fact, I don't like forward prototypes, which are very error prone since they are often not updated when a function is changed. So, unless it is impossible, I always put static functions before their first use.

But it's not my code so I just fixed it for MSVC :-)

I have also just added build files for Visual Studio 2010.

Brian

Last fiddled with by Brian Gladman on 2010-10-30 at 17:33
Brian Gladman is offline   Reply With Quote