<p></p>
<p>Note that there is another such warning coming from here:<br>
<a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/926ec66c11ba4fbabb772eb63303c347c671d89d/platforms/win32/plugins/SoundPlugin/sqWin32Sound.c#L837">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/926ec66c11ba4fbabb772eb63303c347c671d89d/platforms/win32/plugins/SoundPlugin/sqWin32Sound.c#L837</a></p>
<p>I thought that the warning could be abusive see <a href="https://stackoverflow.com/questions/69223499/does-the-following-pre-increment-expression-really-result-in-unsequenced-modific" rel="nofollow">https://stackoverflow.com/questions/69223499/does-the-following-pre-increment-expression-really-result-in-unsequenced-modific</a> but it is not!<br>
We could find a compiler that would output <code>bufferIndex == 2</code> and still comply with the standard.</p>
<p>The funny thing is that the same construct is now well defined in recent C++11 and later, where assignment has become a sequence point. You C guys are running crazy!</p>
<p>Anyway, in doubt, and in order to avoid future reviewing cost of warnings I suggest a simple rewrite.<br>
My understanding is that we want to flip/flop (double buffer) but we should write either a simple</p>
<pre><code>playBufferIndex ^= 1;
</code></pre>
<p>or</p>
<pre><code>playBufferIndex = 1 - playBufferIndex ;
</code></pre>
<p>or</p>
<pre><code>playBufferIndex  = (playBufferIndex + 1) & 1;
</code></pre>
<p>if we want to deal with not properly initialized <code>playBufferIndex</code> (not the case in current code, there is proper initialization of the variable).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/596#issuecomment-921799421">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEW3SEDNSAEQ4L7DZULLUCM7J3ANCNFSM5EGZAOJA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AIJPEW2MGDJKAZFOGZE4WK3UCM7J3A5CNFSM5EGZAOJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG3YYV7I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/596#issuecomment-921799421",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/596#issuecomment-921799421",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>