Mail Archives: djgpp/2001/02/01/04:02:33
On Wed, 31 Jan 2001, Jason Green wrote:
> > Eli Zaretskii wrote:
>
> > > Hmm? Is this in C or in C++? I don't think you need any casts in a C
> > > program for assigning int to a double or the other way around.
> >
> > Nor do you in C++. It's strange that GCC chooses to warn about
> > this in C++ but not in C.
>
> Even stranger when you consider that it does so without even *any*
> -W... switches.
My impression is that this is the general attitude of the G++
developers. It is a source of many flame wars on the GCC mailing
lists (people with strong stomach can try reading that ;-), especially
when serious users of C are trying to keep that attitude at bay and
prevent it from spilling into the C compiler, where it really doesn't
belong.
Since trying to talk to the G++ maintainers them about something like
this is pointless, unless you like being flamed, I won't even try.
> Apart from the obvious problem that the value will be truncated to an
> integer, there is also undefined behaviour when the integer value is
> outside the range of an int.
Undefined behavior means just that. It does _not_ mean the compiler
has to generate diagnostics. When the Standard requires diagnostics,
it says so.
- Raw text -