OpenSmalltalk
/
opensmalltalk-vm
|
Cog
|
55 mins and 11 secs
|
Nicolas Cellier
|
Fix suspiscious logical construction
In code we find this flag:
#define SOCK_BOUND_UDP 0x00040000
and test of this flag in socket state:
if(pss->sockState & SOCK_BOUND_UDP)
We also find the negation:
if(!pss->sockState & SOCK_BOUND_UDP)
But there is a precedenc eproblem in above expression, as reported by the compiler
../../platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c:872:8: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] if(!pss->sockState & SOCK_BOUND_UDP) { ^ ~ ../../platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c:872:8: note: add parentheses after the '!' to evaluate the bitwise operator first if(!pss->sockState & SOCK_BOUND_UDP) { ^ ( ) ../../platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c:872:8: note: add parentheses around left hand side expression to silence this warning if(!pss->sockState & SOCK_BOUND_UDP) { ^ ( )
Above code is interpreted as `if( (!pss->sockState) & SOCK_BOUND_UDP)` which does not mean much...
Please, read C compiler warnings, they are a companion tool !
|
|
|
Would you like to stay up-to-date with the upcoming Travis CI build environment updates? We set up a mailing list for you!
SIGN UP HERE
|
|
|
|
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"action": {
"@type": "ViewAction",
"url": "https://travis-ci.org/OpenSmalltalk/opensmalltalk-vm/builds/465986460?utm_medium=notification&utm_source=email",
"name": "View Build"
},
"description": "View Build #1531 on Travis CI"
}
</script>