>I have simpler questions... why is he using FILEs? Why is he using C header
>files (eg <stdlib.h>) and not C++ header files (eg <cstdlib>)?
I'm working on a project which involves developing numerical
libraries. We do the coding in "c", and provide stubs for
it to be useable from C++ and fortran. Since most of
"c" compiles in "c++", the stubbs of "c++" are provided
using #define, and by compiling with c++ compiler.
Since c++ compiler is supporsed to work with stdio.h, stdlib.h, we use them.
Till now we did'nt whave any problems with this. We were using
eariler versions of gcc/g++ (On various platforms like sun4,
LINUX, freebsd, DEC alpha It also works on other platforms
like IRIX, IBM rs6000, solaris etc... whre we use native
c , c++ compilers.). But on freebsd using g++2.7.2, we get this strange
warinig message, which dos'nt occur on ANY OTHER PRATFORM (other compilers,
older versions of g++, g++2.7.2 on sun4, LINUX, DEC alpha). This
kinad of sugests that either g++-2.7.2 on freebsd is screwed up,
or they implemented a new feature of C++ not implemneted on g++2.7.2
on other arch. In either case, how do i get rid of this warning message?
The code i posted was just a cut out form this project. I added a few
things ( Like the FILE stuff) so that it compiles standalone.
I have a new cut without the FILE stuff which gives the same warnings.
Thanks for the help.
int NewPrintf(char *format,...)
va_start( Argp, format );
va_end( Argp );
int main ()
int a=10, b=20,c=30;
NewPrintf( "A = %d B = %d C = %d\n",a,b,c);
printf.c: In function `int NewPrintf(char * ...)':
printf.c:11: warning: ANSI C++ forbids implicit conversion from `void *' in argument passing
A = 10 B = 20 C = 30