This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Hi,

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:  Peter.Kelb@mchp.siemens.de
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();
}

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]