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]
Other format: [Raw text]

[Bug c++/16515] New: Bad return with a some call of functions


We are studets and in the practice we have a mistake with the compilator 3.2.1 
in this function:

/* Nos retorna la distancia euclidea desde el (0, 0)
	hasta la coordenada del poro pasado como argumento */
	double
	TDeapPoro::ObtenerDistEuclidea( const TPoro &poro ) const
	{

		return ( sqrt ( pow ( (double)poro.PosicionX() , 2 ) +  pow ( 
(double)poro.PosicionY() , 2 ) ) );
	}

poro.PosicionX() and poro.PosicionY() return a integer number.

This function return distint values, but if we compile this in a 3.2.2 works 
right. If we asigned a variable the expression of the return and return the 
variable works right.

Our question is: Doesn't works the 3.2.1 with this succession of functions? 
Does the 3.2.2 resolved this mistake with a internal change?

-- 
           Summary: Bad return with a some call of functions
           Product: gcc
           Version: 3.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: er_mojo_jojo at hotmail dot com
        ReportedBy: er_mojo_jojo at hotmail dot com
                CC: er_mojo_jojo at hotmail dot com,gcc-bugs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16515


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