Closed jacquesg closed 10 years ago
No, that's not how C works. "if you could assign the result of hv_fetch_ent
to slot
" is a nonsensical concept - regardless of the parentheses involved, an assignment expression returns the value of the value assigned, and an if statement tests the truth value of that, not "whether the assignment could work". If you're running into an actual problem here though, I'd be more than willing to look at a failing test.
This was to fix a warning.
XS.xs:601:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (slot = hv_fetch_ent((HV*)SvRV(self), name_key, 0, name_hash)) {
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix a clang warning.