value computed is not used
Alexandre Oliva
oliva@dcc.unicamp.br
Mon Apr 20 13:06:00 GMT 1998
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
More information about the Gcc
mailing list