what's wrong with it?

Andrew Haley aph@redhat.com
Fri Mar 23 19:01:00 GMT 2007


Zhiyong Xu writes:

 > I knew if I put real number parameters, it will work fine.

So you knew the answer already.

 > I just want to know if I did not put function prototype, how system
 > will deal with it, and why it generate this error.

Because in the absence of a prototype, an int is passed to a function
expecting a double.  In the presence of a prototype, the ints are
converted to doubles before being passed.

 > > But working without prototypes is stupid and
 > > pointless.  Don't do it.

Andrew.



More information about the Gcc-help mailing list