By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

warning

P: n/a
Dear all,

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?

thanks a lot.

Jun 25 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Jun 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.