> gcc/ada/init.c (__gnat_install_handler) explicitly does not include
> SA_SIGINFO in sa_flags, which means the handler only gets one arg, sig.
> Still the installed handler (__gnat_error_handler) accesses args beyond
> the first.

Why would it get only one arg?  The comment explicitly says that it gets three.
Or is the prototype bogus in this case?

> There are two possible solutions:
>
> * Actually set SA_SIGINFO.
>
> * Punt and cast the second __gnat_error_handler `arg' to an int.
>   Running under gdb, it seems that three args are really passed.

Why does it not work to just change act.sa_handler to act.sa_sigaction?

> I prefer the first, since that's the clean solution.  Unfortunately, my
> question why the current code doesn't set SA_SIGINFO, yet cites a
> considerable part of the man page about its effects, remained unanswered
> when I submitted the patch.

I'd go for the minimal change that works, including an ugly cast somewhere.

-- 
Eric Botcazou

Reply via email to