uNetworking / uWebSockets

Simple, secure & standards compliant web server for the most demanding of applications
Apache License 2.0
17.41k stars 1.76k forks source link

MSVC warnings #1807

Closed betsch85 closed 21 hours ago

betsch85 commented 22 hours ago

In the following lines, MSVC warns that & might rather be && and *(postPaddedBuffer++) |= 32 has "possible incorrect order of operations" (C6269)

https://github.com/uNetworking/uWebSockets/blob/85b1bda3ef601392ba5e91e0e3803f5e197e9399/src/MessageParser.h#L37-L39

About the first warning, MSVC is probably correct, about the second one, to be honest, I have no idea what the purpose of that expression is

edit: I now understand what |= 32 is for

edit2: nevermind, bitwise and on boolean results is fine, despite the warning

uNetworkingAB commented 21 hours ago

You fix it by putting parenthesis around intended behaviour