This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: conversion warnings in c++
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: Eric Christopher <echristo at apple dot com>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: 11 Jan 2006 19:46:34 -0600
- Subject: Re: conversion warnings in c++
- References: <45D92CE6-2469-4424-BA58-E5428BD9F115@apple.com>
Eric Christopher <echristo@apple.com> writes:
| So, for calls in c++ we're warning unconditionally on something like:
|
| int bar (int a, int b);
|
| int main (void)
| {
| float foo = 5.0;
| float baz = 10.0;
|
| bar (foo, baz);
|
| return 0;
| }
|
| int bar (int a, int b)
| {
| return a + b;
| }
|
| whereas in C we're warning depending on Wtraditional or Wconversion.
| As far as I can tell there's no required diagnostic for this in C++,
| though I could have missed it.
|
| So, either a) did I miss something? or b) any objections to
| conditionalizing the warnings on Wconversion (or some method of
| turning them off)?
-Wconversion is a good idea. I don't think -Wtraditional is relevant.
-- Gaby