Web lists-archives.com

Re: ‘SIG_SETMASK’ and -std=c99

On 8/6/2017 4:43 PM, Ken Brown wrote:
On 8/6/2017 12:59 PM, Marco Atzeri wrote:
hdf5 seems wrong to use sigsetjmp and C99 but Cygwin seems to
have a consistency issue.

I think you're right that Cygwin shouldn't declare or define sigsetjmp under -std=c99. Here's a simple test:

$ cat test.c
#include <setjmp.h>

main ()
   sigjmp_buf env;
   sigsetjmp (env, 0);

On Cygwin:

$ gcc -std=c99 test.c
In file included from /usr/include/setjmp.h:10:0,
                  from test.c:1:
test.c: In function ‘main’:
test.c:7:3: error: ‘SIG_SETMASK’ undeclared (first use in this function)
    sigsetjmp (env, 0);

On Linux:

$ gcc -std=c99 test.c
test.c: In function ‘main’:
test.c:6:3: error: unknown type name ‘sigjmp_buf’
    sigjmp_buf env;
test.c:7:3: warning: implicit declaration of function ‘sigsetjmp’ [-Wimplicit-function-declaration]
    sigsetjmp (env, 0);

I've submitted a patch (https://cygwin.com/ml/cygwin-patches/2017-q3/msg00014.html) which makes the behavior on Cygwin the same as on Linux.


Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple