Home > Back-end >  This warning: the left - hand operand of comma expression has no effect is how to return a responsib
This warning: the left - hand operand of comma expression has no effect is how to return a responsib

Time:10-16

I C code in order to achieve the following formula for computing has the following two statements, but I don't know why returned to this warning (GCC9.2.0 compiler),
warning: left - hand operand of comma expression has no effect value] [Wunused -
This is on the first line,

 double lAX=SQRT (pow ((n * (A.y - camera. Y) - m * (A.z - camera. Z)), 2) + pow ((l * (A.z, camera. Z) - n * (A.x - camera. X)), 2) + pow ((m * (A.x - camera. X) - l * (A.y - camera. Y)), 2));//Only Formula 's step I 
LAX/=SQRT (pow (l, 2), (m, 2) + + pow pow (n, 2));//Step II

Why is that?

CodePudding user response:

(double lAX=SQRT (pow (n * (A.y - camera. Y) - m * (A.z - camera. Z)), 2)
(+ pow (l * ( A.z, camera. Z) - n * (A.x - camera. X)), 2)
(+ pow (m * (A.x - camera. X) - l * (A.y - camera. Y)), 2));//Only Formula 's step I
This is A.z - camera. Z!

CodePudding user response:

It is lawful to comma expression, the compiler to give you this hint, be loved!
So you can't ignore the compiler's warning?
It is necessary to get into the habit of 0 warning programming

CodePudding user response:

Warning: the left - hand operand of comma expression has no effect value] [Wunused -
Clear tell you here, comma expression
  • Related