asdf wrote:
GCC gives me a lot of warning such as
left-hand operand of comma has no effect
right-hand operand of comma has no effect
What does this mean? how to quiet this kind of warning?
It means that you have put some expression on the left of
a comma operator and after evaluating it, the result is
thrown out (which may not be what you want, that's why the
compiler is warning you). I don't know how to quiet it
down, RTFM or ask in 'gnu.g++.help'.
This program might produce this warning (I didn't check):
-------------
void foo(int) {}
int main() {
double pi = 3.14, e = 2.718;
foo((pi * e, 42)); // here, maybe
}
-------------
Now, whether this is intentional or not, it's for you to
decide. Read the FAQ 5.8.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask