• Re: Question about Linux/gcc and the signal() function prototype.

    From Nicolas George@21:1/5 to All on Fri Nov 25 13:05:33 2022
    Kenny McCormack, dans le message <tlqce3$fuhb$[email protected]>, a
    écrit :
    The funny thing is that (at least on my system), nowhere in "man signal"
    does it actually tell you how to declare the signal handler function (that is, as simply "void").

    SYNOPSIS
    #include <signal.h>

    typedef void (*sighandler_t)(int);

    sighandler_t signal(int signum, sighandler_t handler);

    All we need to know is there.

    Except…

    That's the C way...

    Yes, knowledge of the C programming language, how to read type declarations
    and so on, is an implicit prerequisite.

    All of this seems to be an artifact of the fact that functions and pointers to functions are (basically) the same thing.

    No they are not.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Fri Nov 25 14:01:54 2022
    In article <6380bd9d$0$3065$[email protected]>,
    Nicolas George <nicolas$[email protected]> wrote:
    Kenny McCormack, dans le message <tlqce3$fuhb$[email protected]>, a
    crit:
    The funny thing is that (at least on my system), nowhere in "man signal"
    does it actually tell you how to declare the signal handler function (that >> is, as simply "void").

    SYNOPSIS
    #include <signal.h>

    typedef void (*sighandler_t)(int);

    sighandler_t signal(int signum, sighandler_t handler);

    All we need to know is there.

    Except

    That's the C way...

    Yes, knowledge of the C programming language, how to read type declarations >and so on, is an implicit prerequisite.

    All of this seems to be an artifact of the fact that functions and pointers >> to functions are (basically) the same thing.

    No they are not.

    What a totally stupid response.

    You hit all the marks. Congrats.

    --
    I love the poorly educated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)