Re: -Wstrict-prototypes for extensions

From: Jeff Mitchell <quixoticsycophant@...>
Date: 2004-05-25 03:40:58 UTC
List: ruby-core #2944
> Sorry, but I can't get your point.
> 
> At first, your example in [ruby-core:02938] shouln't be like
> this?  It doesn't seem to be concerned with ruby.h.
> 
>   double f(void)
>   {
>       return 99.0 ;
>   }
>   int main(void)
>   {
>       int a = f() ;
>       /* ------> a contains junk <------ */
>       printf("%d\n", a) ;
>   }

If f() is defined after main(), it compiles with a warning,
and "a" has a junk value.  That case is not problematic, since
you know to move the function as you did.  However if f() is
defined in a different file, without -Wstrict-prototypes it
compiles with NO warning, and "a" gets a junk value.



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

In This Thread