This is the mail archive of the gcc@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]

Re: value computed is not used


Shigeya Suzuki <shigeya@foretune.co.jp> writes:

> 	for (m_x1 != 0 && m_x1->eval();     // line 25
> 	     m_x2 != 0 && m_x2->eval();
> 	     m_x3 != 0 && m_x3->eval()) {
> 	}
>     }

> dream 18% g++ -Wall -c z.cpp
> z.cpp: In method `void Cy::exec()':
> z.cpp:25: warning: value computed is not used
> z.cpp:28: warning: value computed is not used

> Why this happen?

Because the result of the expression `m_x1 != 0 && m_x1->eval()' is
not used at all.  Only the result of `m_x2...' is used to check
whether the loop must be repeated or not, the other two expressions
have their results discarded, so you get the warning.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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