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]

wrong warning..


hi there,

we are using egcs on solaris 2.6 and linux 2.0.34.
egcs -v on linux:

Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)

when compiling the appended source code with

  g++ -c bug.cc -O2 -Wuninitialized

the following output appears (ONLY UNDER LINUX):

bug.cc: In function `bool f()':
bug.cc:24: warning: `bool c' might be used uninitialized in this function

(when commenting out dtor of class S - no warning)

i guess its no serious bug but we are compiling all of our sources
with -Werror and we get very much of that warning-stuff above.
so i will be very pleased if this is solved.

thanks in advance
  dirk sorges   (socke@aquaplan.de)


------------------- bug.cc ---------------------------------------

class S { 
		
  public: 
	
	 S();
	 ~S();
	 	 
	 friend int operator==(const S&, int);

};

class B {

  public:

	 S a();

};

bool f()
{
	B b;
	
	bool c = (b.a() == 1);
	bool d = (b.a() == 2);
	
	return (c && d);
}

------------------------------------------------------------------


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