Closed
Description
Producing code from goto-files that reference signal.h
causes several problems.
Example program:
#include<signal.h>
#include<stdlib.h>
void sig_block(int sig)
{
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss, sig);
sigprocmask(SIG_BLOCK, &ss, NULL);
}
int main() {
sig_block(0);
return 0;
}
Resulting C file (produced with goto-instrument):
#include <signal.h>
#ifndef NULL
#define NULL ((void*)0)
#endif
// sig_block
// file example_typedef_sigset.c line 4
void sig_block(signed int sig);
signed int main()
{
sig_block(0);
return 0;
}
void sig_block(signed int sig)
{
struct anonymous ss;
sigemptyset(&ss);
sigaddset(&ss, sig);
sigprocmask(0, &ss, ((sigset_t *)NULL));
}
Especially the translation of sigset_t ss;
to struct anonymous ss;
seems to be critical (the struct anonymous is declared/defined nowhere).