On Tue, Nov 07, 2000 at 11:30:05PM +1000, [EMAIL PROTECTED] wrote:
>
> On Tue, 7 Nov 2000, Giorgos Keramidas wrote:
>
> > discovered the following funny thing about -Wconversion and umask(2),
>
> I spent quite a while trying to silence that warning in one of my programs
> the otherday but I decided it was probably harmless and left it.
The warning in itself is rather harmless, since it does not cause
much trouble. However some parts of a FreeBSD world are compiled
with -Werror, and every warning is considered an error that causes
compilation to abort :>
Anyway, this is getting more and more off-topic, since it's obviously
something caused by GCC's strictness when -Wconversion is used.
> I think the reason that the cast doesn't help (or passing a u_int16_t)
> is that when the 16 bit number gets passed it has to be placed on
> the 32 bit stack which promotes it so you will always end up with a
> demotion when the number is taken from the stack and given to umaks as
> a 16 bit int.
I thought that the cast would help because the size of (mode_t) is known
in compile time, and I expected the compiler to place the result of an
expression like `(mode_t) 0' in a properly sized integer type. I mean,
one would expect that ((short) 0) would be different than ((int) 0);
isn't the compiler supposed to know the diference, if both types have
sizes that are known at compile time?
Whatever... I will also remove -Wconversion from my make.conf CFLAGS
and move on. This is probably discussed with the GCC fellows. I will
sum up what this thread was all about, and post a mail to their lists
tomorrow. I'm too tired to write to them right now.
- giorgos
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message