Bug path

main
‘main’: events 1-2
21int main(int argc, const char *argv)
^~~~
|
(1) entry to ‘main’
[...]
25 signal(SIGINT, handler); /* { dg-message "registering 'handler' as signal handler" } */
~~~~~~~~~~~~~~~~~~~~~~~
|
(2) registering ‘handler’ as signal handler
event 3
(3): later on, when the signal is delivered to the process
handler
‘handler’: events 4-5
16static void handler(int signum)
^~~~~~~
|
(4) entry to ‘handler’
17{
18 custom_logger("got signal");
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
(5) calling ‘custom_logger’ from ‘handler’
custom_logger
‘custom_logger’: events 6-7
11void custom_logger(const char *msg)
^~~~~~~~~~~~~
|
(6) entry to ‘custom_logger’
12{
13 fprintf(stderr, "LOG: %s", msg); /* { dg-warning "call to 'fprintf' from within signal handler" } */
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
(7) call to ‘fprintf’ from within signal handler