This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: value computed is not used
- To: Shigeya Suzuki <shigeya at foretune dot co dot jp>
- Subject: Re: value computed is not used
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 20 Apr 1998 16:57:30 -0300
- Cc: egcs at cygnus dot com
- References: <19980420173404U.shigeya@foretune.co.jp>
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