Error: implicit declaration of function 'siglongjmp'

marjonz
Posts: 13
Joined: Thu Aug 09, 2018 7:33 pm

Error: implicit declaration of function 'siglongjmp'

Postby marjonz » Thu Sep 13, 2018 11:12 pm

I am porting a function that calls siglongjmp(). I have included the <setjmp.h>, which includes the machine implementation of the <machine/setjmp.h>, which has the definition for the siglongjmp(). But for some reason it still just keeps throwing me that error.

Any ideas?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Error: implicit declaration of function 'siglongjmp'

Postby ESP_Angus » Mon Sep 17, 2018 12:14 am

ESP-IDF includes the standard newlib libc header files, but there are some things in the header which don't make sense in the IDF context - for example we don't have POSIX signals, so siglongjmp isn't really needed.

You may be able to work around this by ignoring the signal handling mask arguments, and writing some wrappers in a separate .c file which just call setlongjmp & longjmp. Something like (untested code):

Code: Select all

int sigsetjmp(sigjmp_buf env, int savesigs)
{
    return setjmp((jmp_buf)env);
}

void siglongjmp(sigjmp_buf env)
{
    return longjmp(jmp_buf)env);
}

marjonz
Posts: 13
Joined: Thu Aug 09, 2018 7:33 pm

Re: Error: implicit declaration of function 'siglongjmp'

Postby marjonz » Fri Sep 28, 2018 1:39 am

thank you. will try it.

Who is online

Users browsing this forum: No registered users and 267 guests