jmp_buf definition violates C standard
Brought to you by:
noxorc
jmp_buf in the current gnu-efi is a structure, which means it needs to be accessed using & to make a pointer. The C standard is that it is used without &. The standard solution for this is to typedef jmp_buf as an array, usually of size 1:
typedef struct __jmp_buf jmp_buf[1];
Hello Peter,
I looked at the code to see if I can understand what you are after.
Can you provide a patch so I can compare?
Thanks, Nigel
Current API gives:
static jmp_buf load_error_buf;
...
setjmp(&load_error_buf)
...
longjmp(&load_error_buf, 1);
But standard C says I/F should be:
static jmp_buf load_error_buf;
..
setjmp(load_error_buf);
..
longjmp(load_error_buf, 1);
Redefining jmp_buf to:
typedef struct jmp_buf jmp_buf[1];
will fix the api to std C
Compile tested patch attached
Patch reviewed and accepted
commit 5b74db0e154ffd2fba4bcc254069844f21913988