Issue 61600
Summary Clang has too strict warning on unsequenced modification and access?
Labels
Assignees
Reporter nomennescio
    Consider this code (https://godbolt.org/z/q8Pd399hG)
```
char *map (char *s, int (*f)(int)) { char *p=s; for (;*p;) *p++=f (*p); return s; }
```
Clang (trunk) gives a warning:
```
<source>:1:62: warning: unsequenced modification and access to 'p' [-Wunsequenced]
char *map (char *s, int (*f)(int)) { char *p=s; for (;*p;) *p++=f (*p); return s; }
 ^      ~
```

Now, there should be a sequence point between passing the arguments to a function, and returning from that function, and I think that should also hold for function pointers. Isn't the warning therefore too strict?

Might be related to #60931
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to