coin-or / Clp

COIN-OR Linear Programming Solver
Other
396 stars 82 forks source link

Compiler warning #164

Open BjornPetersen opened 3 years ago

BjornPetersen commented 3 years ago

For ClpPackedMatrix.cpp.

Compiler gives this warning: warning C4554: '&': check operator precedence for possible error; use parentheses to clarify precedence

But what is supposed to happen here: if (nOther<MAX_ONES&nOnes<MAX_ONES)...

is it: if ((nOther < MAX_ONES) & (nOnes < MAX_ONES))... or if (nOther < MAX_ONES && nOnes < MAX_ONES)... or if (nOther < (MAX_ONES & nOnes) < MAX_ONES)...?

jjhforrest commented 3 years ago

&&

Thanks (I think both same in practice)

John Forrest

On 27/10/2020 14:33, BjornPetersen wrote:

Compiler gives this warning: warning C4554: '&': check operator precedence for possible error; use parentheses to clarify precedence

But what is supposed to happen here: |if (nOther<MAX_ONES&nOnes<MAX_ONES)...|

is it: |if ((nOther < MAX_ONES) & (nOnes < MAX_ONES))...| or |if (nOther < MAX_ONES && nOnes < MAX_ONES)...|?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coin-or/Clp/issues/164, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHDNOY277AGLZEQM3QDSM3K5LANCNFSM4TA5IUUQ.