[Bug c/88737] RFE: Track ownership moves

2023-12-17 Thread uecker at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #10 from uecker at gcc dot gnu.org --- I would say it is rather likely that C will get something like this at some point. BTW: Any use of the pointer value after free as in comment #2 is UB.

[Bug c/88737] RFE: Track ownership moves

2023-12-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #9 from Richard Biener --- We do now have the analyzer and -Wuse-after-free. I don't think a rust-like borrow checking feature will ever work or is sensible to implement in C. Use rust if you need such a feature. I'm also not sure

[Bug c/88737] RFE: Track ownership moves

2019-12-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #8 from Eric Gallager --- (In reply to Neal H. Walfield from comment #0) > I would like an attribute to indicate that ownership of an argument is moved > to the function. That is, any subsequent accesses to the variable should be >

[Bug c/88737] RFE: Track ownership moves

2019-01-12 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #7 from Martin Sebor --- (In reply to Jakub Jelinek from comment #2) > Wouldn't that break e.g. programs that > free (a); > return (uintptr_t) a % 16; > or similar (i.e. inspect the bits of the pointer rather than what it points

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 Eric Gallager changed: What|Removed |Added Keywords||diagnostic CC|

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #5 from Marc Glisse --- (In reply to rguent...@suse.de from comment #3) > Indeed. So it would be > > *a = {CLOBBER}; > > which is of course somewhat difficult since we do not know the size > of the object pointed to. One thing

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread neal at walfield dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #4 from Neal H. Walfield --- I'm not sure what '*a = {CLOBBER};' does and I'm having trouble finding documentation for it so the following comment might be unnecessary. Nevertheless: when I say "move", I don't mean that the object

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #3 from rguenther at suse dot de --- On Mon, 7 Jan 2019, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 > > --- Comment #2 from Jakub Jelinek --- > Wouldn't that break e.g. programs that >

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 --- Comment #2 from Jakub Jelinek --- Wouldn't that break e.g. programs that free (a); return (uintptr_t) a % 16; or similar (i.e. inspect the bits of the pointer rather than what it points to)? That should be valid even after free, free

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 Richard Biener changed: What|Removed |Added Severity|normal |enhancement

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 Richard Biener changed: What|Removed |Added CC||jakub at gcc dot gnu.org,

[Bug c/88737] RFE: Track ownership moves

2019-01-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88737 Jonathan Wakely changed: What|Removed |Added Severity|normal |enhancement