On Tue, 7 Nov 2000, Peter Pentchev wrote:
> In my experience, the problem is not only with umask(2) - GCC *is*
> a bit stubborn about -Wconversion; I wonder if this is really a GCC bug :(
>
> I'm having the same problems with many other functions when passing
> integer constants - even if I explicitly cast them to a long or unsigned
> long or plain unsigned int or whatever the particular function needs,
> GCC seems to ignore the cast and whines about the conversion nonetheless :(
>
> Can anybody else confirm this? I can't dig out a code snippet right now,
> but ISTR a recurring case of this when compiling with BDECFLAGS a program
> which includes ncurses.h, then passes integer constants to init_pair()
> or something similar.
What happens if you pass an explicit long or unsigned long
literal instead of casting an integer literal? Like this:
void myfunc( unsigned long);
int
main( int argc, char* argv[])
{
myfunc( 12UL);
return 0;
}
I realize, of course, that going through and changing every array
subscript, for example, is a PITA. I'm just curious about whether or
not this makes gcc behave nicely.
--
Chris BeHanna
Software Engineer (at yourfit.com)
[EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message