On Thu, 13 Jan 2011 11:01:29 -0700
Dave Smith <[email protected]> wrote:

> I am starting to wonder if 
> maybe RHEL patches g++.

They may well. Red Hat bought out Cygnus, at that time the greatest
concentration of GCC contributors going.

> 
> The warning is this:
> 
>     double d = 42.0;
>     int i = d; // Warning here

Without an explicit cast, shouldn't that be fatal? As you say, it
isn't. On Ubuntu, even with gcc -Wall, I get no warning.

In any case, don't do that. The ANSI C standard leaves undefined the
results of such a conversion, which means you are at the mercy of the
implementor.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to