[splint-discuss] Parse Error on siginfo_t

Yoshioka Tsuneo tsuneo.yoshioka at f-secure.com
Sun Jan 28 22:02:28 PST 2007


Hello

Thank you very much for providing nice software to build secure software.

Well, I just tried to use splint.
But, I got Parse Error on siginfo_t. I just tried to add "+posixlib" or
"posixstrictlib", but this does not solve the issue.
Can I get any information to avoid this error ?

Command result and test code is below. I have tested using splint 3.1.1
on RedHat EL3.0. (I got the same result on RedHat EL4.0, too.)


Command Result:
==========================================================================
# splint sigtest1.c
Splint 3.1.1 --- 26 Jan 2007

sigtest1.c:2: Include file <unistd.h> matches the name of a POSIX library, but
    the POSIX library is not being used.  Consider using +posixlib or
    +posixstrictlib to select the POSIX library, or -warnposix to suppress this
    message.
  Header name matches a POSIX header, but the POSIX library is not selected.
  (Use -warnposixheaders to inhibit warning)
sigtest1.c:8:39: Parse Error: Inconsistent function parameter syntax:
    siginfo_t : <any>. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.


# splint +posixlib sigtest1.c
Splint 3.1.1 --- 26 Jan 2007

sigtest1.c:8:39: Parse Error: Inconsistent function parameter syntax:
    siginfo_t : <any>. (For help on parse errors, see splint -help
    parseerrors.)
*** Cannot continue.


# splint +posixstrictlib sigtest1.c
Splint 3.1.1 --- 26 Jan 2007

sigtest1.c:8:39: Parse Error: Inconsistent function parameter syntax:
    siginfo_t : <any>. (For help on parse errors, see splint -help
    parseerrors.)
*** Cannot continue.
=============================================================================


Test code(sigtest1.c)
=============================================================================
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#include <signal.h>

void signal_handler(int sig, siginfo_t *info, void *context)
{
    printf("sig=%d, si_code=%d, si_pid=%d\n"
        , info->si_signo, info->si_code, info->si_pid);
    alarm(1);
}
int main(int argc, char *argv[])
{
    struct sigaction sa;

    memset(&sa, 0, sizeof(sa));
    sa.sa_sigaction = signal_handler;
    sa.sa_flags |= (SA_RESTART|SA_SIGINFO);
    sigemptyset(&sa.sa_mask);
    sigaddset(&sa.sa_mask, SIGALRM);

    sigaction(SIGALRM, &sa, NULL);
    alarm(1);

    while(1){sleep(1);}

    return 0;
}
=============================================================================

Thank you.

-- 
Nihon F-Secure Corporation
Yoshioka Tsuneo
E-MAIL: Tsuneo.Yoshioka at f-secure.com




More information about the splint-discuss mailing list