https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
--- Comment #7 from Andrew Pinski ---
(In reply to Jonathan Wakely from comment #6)
> I don't know the origin of this function, it doesn't seem to be in BSD or
> SVR4.
https://man7.org/linux/man-pages/man3/on_exit.3.html mentions SunOS 4 (but
re
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
--- Comment #6 from Jonathan Wakely ---
FWIW Glibc defines this with _DEFAULT_SOURCE and _GNU_SOURCE:
#ifdef __USE_MISC
/* Register a function to be called with the status
given to `exit' and the given argument. */
extern int on_exit (void
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
--- Comment #5 from Kris ---
Fair do's. But then, IMHO, 'on_exit' shouldn't pollute the global namespace
either. Hence, it should be prefixed with '__'?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
--- Comment #4 from Jonathan Wakely ---
Right, on_exit is not part of the C++ standard, so it's correct that it is not
in namespace std.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
--- Comment #2 from Andrew Pinski ---
Also on_exit is not part of the C++ standard at all.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
--- Comment #1 from Andrew Pinski ---
This is most likely because _GNU_SOURCE is defined when compiling with C++ code
in GNU C++ mode.