strange warning 'control reaches end of non-void function'

Peter Kelb
Fri Mar 10 01:39:00 GMT 2000

I get a strange warning in the following case:
gcc version: 2.95.1
system type: PC pentium III, Linux Suse 6.2
gcc call: g++ -O -Wall t1.C
Can you help. Regards, Peter Kelb
Dr. Peter Kelb                  phone:   (+49) 89 636 45890
Siemens AG, ZT SE 4             fax:     (+49) 89 636 42284
Otto-Hahn-Ring 6                e-mail:
D-81739 Muenchen, Germany


"As an adolescent I aspired to lasting fame, I craved factual
certainty, and I thirsted for a meaningful vision of human life
-- so I became a scientist.  This is like becoming an archbishop
so you can meet girls."
                        -- Matt Cartmill
#include <vector>
#include <iostream>

struct A {

	A() {cout << "juhu\n";}
	int m_i;

A* create() {
	vector<A> arNewArgs;
	return new A();

main() {
	A* pA = 0;
	pA = create();
	cout << pA << "\n";

More information about the Gcc-bugs mailing list