Aw: Re: Warning: shared mutable data

2023-02-17 Thread Helmut Zeisel via Gcc
Von: "Jonathan Wakely"  > What exactly are you suggesting for the semantics of the warning? Good question. It is difficult to detect all suspiscious cases, but at least some of the can be defined: If we have a function prototype f(...,Ti xi,...Tj xj,...) and call the function f(... xi, ..

Re: Warning: shared mutable data

2023-02-17 Thread Jonathan Wakely via Gcc
const > or is there some mutable argument?) > and it might be possible to add a warning "shared mutable data". > > How difficult is it to implement such a warning? > What exactly are you suggesting for the semantics of the warning? You haven't described what you want it

Warning: shared mutable data

2023-02-17 Thread Helmut Zeisel via Gcc
forbids such code. From my understanding, however, sharing of mutable data can be detected by the compiler on caller side (looking at the prototype of the function - are all shared arguments const or is there some mutable argument?) and it might be possible to add a warning "shared mutable data&q