view gcc/testsuite/gcc.dg/analyzer/signal-6.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

#include <stdio.h>
#include <signal.h>

extern void body_of_program(void);

/* Example of a non-static signal handler.  */

void handler(int signum)
{
  fprintf(stderr, "LOG: %i", signum); /* { dg-warning "call to 'fprintf' from within signal handler" } */
}

int main(int argc, const char *argv)
{
  signal(SIGINT, handler); /* { dg-message "registering 'handler' as signal handler" } */

  body_of_program();

  return 0;
}