Re: what's wrong with it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I knew if I put real number parameters, it will work
fine.
I just want to know if I did not put function
prototype, how system will deal with it, and why it
generate this error.

Could you please tell me? Thanks,



--- Andrew Haley <aph@xxxxxxxxxx> wrote:

> Zhiyong Xu writes:
>  
>  > 
>  > here's the description:
>  > 1. I have a function evaluate defined in t.c
>  > 2. in ex.c, I call function evaluate without
> prototype
>  > defined. 
>  > using gcc -lm ex.c t.c, I can generate the
> executable
>  > file a.out,
>  > when executing, the result is wrong
>  > 3. if I modify ex.c, add the prototype
> definition, the
>  > result is correct.
>  > 
>  > Anything wrong with the first case?
> 
> Yes:
> 
> int main(void)
> {
>         evaluate(sin, 2.0,3.0,4.0);
>         evaluate(sqrt,2.0,3.0,4.0);
> 
>         return(0);
> }
> 
> But working without ptototypes is stupid and
> pointless.  Don't do it.
> 
> Andrew.
> 



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux