[Bug c/119066] Warn when address of local variable is passed to on_exit

2025-02-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119066 --- Comment #2 from Jonathan Wakely --- I don't think users should be calling __cxa_atexit themselves. But since the data argument is typically the address of a global variable with static storage duration, it would be OK to warn if it's passed

[Bug c/119066] Warn when address of local variable is passed to on_exit

2025-02-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119066 --- Comment #1 from Andrew Pinski --- I was going to mention at_exit but that does not have a data arguments. But __cxa_atexit does (and __aeabi_atexit too). Warning about those might be just as useful.