<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60931>60931</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang 8 / C18 too strict warning about "multiple unsequenced modifications"?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nomennescio
</td>
</tr>
</table>
<pre>
Clang 8 / C18 warns about the following code snippet:
```
int d;
int cmp (int *a, int *b) { return d*(*a-*b); }
...
int P[n],O[n],b=f (n,(qsort (memcpy (P,p,n*I),n,I,(d=1,cmp)),P),(qsort (memcpy (O,o,n*I),n,I,(d=-1,cmp)),O));
```
with the following warning:
```
solution.c:13:57: warning: multiple unsequenced modifications to 'd' [-Wunsequenced]
```
However, a sequence point exists between passing arguments to a function, and returning from that function, and one exists in evaluation of the expressions that have comma expressions. So yes, the order of evaluating the arguments to `f` is not determined, but the modifications to `d` are accurately sequenced in their semantics. Isn't the warning too strict? Or otherwise said, can any hints be given that `d` is only used in `cmp` with no consequence of the undetermined evaluation of `f`?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVEGvqzgP_TXuxiqCpEC7YNFSVd9d3St9i1mHxEBGkPCS0L7--1Ggfb1z75uZqiqmzjm2jx0L73VniCrIT5CfN2IOvXWVsSMZQ15qu2msulf1IEyHewR2wTrb400441E0dg4YesLWDoO9adOhtIrQGz1NFIAfIT1DeoQifXyXV20CKuCn15scJwS2jyawowBW48NugB0QyhM6CrMzqIAdge3jqe3DDfyEUJ5XtiRJXrQfkJ8M5Gdg9fvLbICf2xjOAKuB7X9462Ks_UijnO7R-gBWT8BqA-z4FkMsZv22AhTwcwasluO0-KL7Y338nu4dWG3_lW77le_9YT1V-iLhTYf-i_KxJ9p0_yS6t8MctDWJBH7MOPBjXgI_foLhOA9BTwPhbDz9mMlIUjhapVstRcR6DBaBlQpYiZCftn98OhnF_V3g9fd_9kZXcrGzAp8YnGxsE_3UPnhsKNyIDE5xKk2HwnXzSCYsUQW2s5ExiYXCqMdAxIOtsyOGXoRvZ6yhJ7s2SFcxzEshaNtFPfo5OfJ-LS0S9OJKKO04is--BP9v8U4-0kaYdYpc5Hgymm75_28ZQ5G2UKSoPRobUFEgN2pDKrI0j4vzXd0iVRElHKGQcnYi0HDHVz-0iUDt0NMoTNDSJ_jmDbByZXz0E4O16IPTMgC_4LtDG3pyN-0JvdBLElIYFOaOvTaL_NjpK5lViGce2qM1wx1nv8aGIo1jWqS4jKCxKO2vGXjKOptXtV9Uf6gC_LLOxUZVXB34QWyoyoqyzNKClbtNX2V8l7PikLaFynhZlortU5nxLC_UvixS2uiKpYynLH7yLNslaZ418pDJNmuU2rcZ7FIahR6SYbiOiXXdRns_U1WkB55tBtHQ4JfFx5ihGy5OYCzuQVdFzLaZOw-7dIgD9GIJOgz0bSW-9P7VgnU_AmP_fbFiXH7ZzG6o-hAmH28xuwC7dDr0c5NIOwK7xBQej-3k7J8kA7DLkrgHdlkK-ysAAP__n23S5A">