This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug/feature request for initialisation warnings
- To: egcs-bugs at cygnus dot com
- Subject: Bug/feature request for initialisation warnings
- From: njs3 at doc dot ic dot ac dot uk (Niall Smart)
- Date: Fri, 5 Jun 1998 18:15:38 +0100
Hi,
Consider the following:
class F
{
public:
void foo(char c);
static void bar(char c);
};
int
main()
{
F f;
char c = 23.23; // warning
c = 9435.23; // warning
F::bar(23.23); // no warning
f.foo(23.23); // no warning
}
The last two function calls do not elicit a warning from the compiler
even though the initialisation of the argument c in foo and bar is
equivalent to the initialisation of the auto variable c in main().
A warning should be printed in all cases.
Please CC me on any replies.
Regards,
Niall