Ben Laurie wrote:
>
> Jeffrey Altman wrote:
> >
> > > Richard Levitte - VMS Whacker <[EMAIL PROTECTED]> ,in message <20000202220
> > > [EMAIL PROTECTED]>, wrote:
> > >
> > > > I think the real problem is that an attempt is made to compile stack.c
> > > > as a C++ file, not a C one. What should be done is to tell the
> > > > compiler that it shouldn't use C++ semantics...
> > >
> > > #include it within an extern "C" { } ? I'm not sure if that's going to be
> > > effective.
> > >
> > > I guess it's just an error to try to compile C with a C++ compiler. You
> > > don't try to compile pascal with a fortran compiler, eh?
> >
> > The Visual C++ compiler does not compile a .c file with C++ semantics
> > unless a special command line switch is thrown. stack.c is being
> > compiled as a ANSI C program. The compiler is correct.
> >
> > void (*func)()
> >
> > means
> >
> > void (*func)(void)
> >
> > in ANSI C.
> >
> > func(foo);
> >
> > calls func() with a single parameter which is one more parameter than
> > the function pointer is declared to accept.
>
> Not according to K&R Ed. 2 - they say that void (*func)() is equivalent
> to void (*func)(...).
>
I have seen VC++ interpret func() as func(void) and I've made a few
changes to the source to accommodate it: normally just adding a
prototype to a function pointer.
That particular example is a bit trickier though because it really does
need unspecified parameters or an evil wrapper for every occurrence.
However this may be just a compiler switch problem because that code is
identical in the latest snapshot and with the standard Win32 makefile it
compiles with my VC++ 6.0 (SP3) just fine.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]