Bug/feature request for initialisation warnings

Niall Smart njs3@doc.ic.ac.uk
Fri Jun 5 10:15:00 GMT 1998


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



More information about the Gcc-bugs mailing list