From: Neil Booth <neil@daikokuya.demon.co.uk>
To: "Ralf W. Grosse-Kunstleve" <rwgk@cci.lbl.gov>
Cc: gcc@gcc.gnu.org, rwgk@boa.lbl.gov
Subject: Re: warning: assignment to `int' from `double'
Date: Wed, 27 Feb 2002 11:14:00 -0000 [thread overview]
Message-ID: <20020227190659.GB30162@daikokuya.demon.co.uk> (raw)
In-Reply-To: <200202271824.g1RIOsc53303@boa.lbl.gov>
Ralf W. Grosse-Kunstleve wrote:-
> The following code generates warnings with gcc 3.0.3:
>
> int main()
> {
> int i;
> double d;
> i = 0;
> i += d;
> return 0;
> }
>
> g++ -g z.cpp -o z
>
> z.cpp: In function `int main()':
> z.cpp:6: warning: assignment to `int' from `double'
> z.cpp:6: warning: argument to `int' from `double'
>
> Is it possible to suppress this warning without resorting to -w?
Have you tried a cast?
Neil.
next prev parent reply other threads:[~2002-02-27 19:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-27 10:29 Ralf W. Grosse-Kunstleve
2002-02-27 11:14 ` Neil Booth [this message]
2002-02-27 11:30 Ralf W. Grosse-Kunstleve
2002-02-27 15:27 Ralf W. Grosse-Kunstleve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020227190659.GB30162@daikokuya.demon.co.uk \
--to=neil@daikokuya.demon.co.uk \
--cc=gcc@gcc.gnu.org \
--cc=rwgk@boa.lbl.gov \
--cc=rwgk@cci.lbl.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).