Path: utzoo!telly!philmtl!uunet!tut.cis.ohio-state.edu!CS.PURDUE.EDU!sja From: sja@CS.PURDUE.EDU Newsgroups: gnu.g++.bug Subject: two declaration of malloc Message-ID: <8910211607.AA26443@medusa.cs.purdue.edu> Date: 21 Oct 89 16:07:28 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 33 I am having trouble compiling following program ---------------- extern "C" { #include } #include main() { printf("done\n"); } ---------------- I get the msg: make -k g++ -c -I/usr/local/gnu/lib/g++-1.35.1.lib/g++-include l.cc /usr/local/gnu/lib/g++-1.35.1.lib/g++-include/std.h:119: conflicting types for `void *malloc (unsigned int)' *** Error code 1 --------------- The problem is that has extern char* malloc(); => extern char* malloc(...) This declaration conflicts with the void *malloc(unsigned int); Is there a way to tell the compiler that both declarations refers to the same malloc function ? How is overload resolution done in g++ ? I would appreciate any information in this regard. Thanks, Jags sja@cs.purdue.edu