Re: [PATCH v4] abort: clarify consequences of calling abort

Tomáš Golembiovský
2023-07-20T15:45:19Z

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

Hi,

attached is a small test program. Compile simply with:

$ gcc atexit.c -o atexit

When running the test I get:

$ ./atexit
terminating
on_exit called
atexit called

When the abort() call is uncommented I get:

$ ./atexit
terminating
Aborted (core dumped)

Hope this helps,

Tomas

[-- Attachment #2: atexit.c --]
[-- Type: text/plain, Size: 292 bytes --]

#define _DEFAULT_SOURCE

#include <stdio.h>
#include <stdlib.h>

void one(void) {
puts("atexit called");
}

void two(int, void*) {
puts("on_exit called");
}

int main(void) {
atexit(one);
on_exit(two, NULL);

puts("terminating");
//abort();
exit (EXIT_SUCCESS);
}