* ‘SIG_SETMASK’ and -std=c99
@ 2017-08-06 9:04 Marco Atzeri
2017-08-06 9:44 ` Achim Gratz
0 siblings, 1 reply; 7+ messages in thread
From: Marco Atzeri @ 2017-08-06 9:04 UTC (permalink / raw)
To: cygwin
building again hdf5-1.8.18 on latest cygwin I hit
error: âSIG_SETMASKâ undeclared
removing "-std=c99" from CFLAGS solves the issue.
As before the "-std=c99" was not causing any problem , it is not clear
to me if the current behavior is correct or a side effect of latest
cygwin header reshuffle.
Regards
Marco
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ‘SIG_SETMASK’ and -std=c99
2017-08-06 9:04 ‘SIG_SETMASK’ and -std=c99 Marco Atzeri
@ 2017-08-06 9:44 ` Achim Gratz
2017-08-06 14:52 ` Marco Atzeri
0 siblings, 1 reply; 7+ messages in thread
From: Achim Gratz @ 2017-08-06 9:44 UTC (permalink / raw)
To: cygwin
Marco Atzeri writes:
> building again hdf5-1.8.18 on latest cygwin I hit
>
> error: ‘SIG_SETMASK’ undeclared
>
> removing "-std=c99" from CFLAGS solves the issue.
https://stackoverflow.com/questions/20849917/invalid-signal-processing-library-in-linux
> As before the "-std=c99" was not causing any problem , it is not clear
> to me if the current behavior is correct or a side effect of latest
> cygwin header reshuffle.
The "-std=c*" options are not meant to expose any symbols that are not
defined in the respective C standard. You almost always want to use
"-std=gnu*" instead if you target POSIX-y systems.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ‘SIG_SETMASK’ and -std=c99
2017-08-06 9:44 ` Achim Gratz
@ 2017-08-06 14:52 ` Marco Atzeri
2017-08-06 16:16 ` Ken Brown
0 siblings, 1 reply; 7+ messages in thread
From: Marco Atzeri @ 2017-08-06 14:52 UTC (permalink / raw)
To: cygwin
On 06/08/2017 11:44, Achim Gratz wrote:
> Marco Atzeri writes:
>> building again hdf5-1.8.18 on latest cygwin I hit
>>
>> error: âSIG_SETMASKâ undeclared
>>
>> removing "-std=c99" from CFLAGS solves the issue.
>
> https://stackoverflow.com/questions/20849917/invalid-signal-processing-library-in-linux
That is not very informative as signal.h is in C99.
http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
however SIG_SETMASK is not
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
>
>> As before the "-std=c99" was not causing any problem , it is not clear
>> to me if the current behavior is correct or a side effect of latest
>> cygwin header reshuffle.
>
> The "-std=c*" options are not meant to expose any symbols that are not
> defined in the respective C standard. You almost always want to use
> "-std=gnu*" instead if you target POSIX-y systems.
formally you are right. However it seems that Cygwin is now
more stringent than Linux where this problem does not arise.
> Regards,
> Achim.
Regards
Marco
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ‘SIG_SETMASK’ and -std=c99
2017-08-06 14:52 ` Marco Atzeri
@ 2017-08-06 16:16 ` Ken Brown
2017-08-06 17:00 ` Marco Atzeri
0 siblings, 1 reply; 7+ messages in thread
From: Ken Brown @ 2017-08-06 16:16 UTC (permalink / raw)
To: cygwin
On 8/6/2017 10:51 AM, Marco Atzeri wrote:
> On 06/08/2017 11:44, Achim Gratz wrote:
>> The "-std=c*" options are not meant to expose any symbols that are not
>> defined in the respective C standard. You almost always want to use
>> "-std=gnu*" instead if you target POSIX-y systems.
>
> formally you are right. However it seems that Cygwin is now
> more stringent than Linux where this problem does not arise.
That's not what I see on Linux (Scientific Linux 7.2):
$ cat test.c
#include <signal.h>
#include <stdio.h>
int
main ()
{
#ifdef SIG_SETMASK
printf ("SIG_SETMASK is defined.\n");
#else
printf ("SIG_SETMASK is not defined.\n");
#endif
}
$ gcc -o test test.c
$ gcc -std=c99 -o test_c99 test.c
$ ./test
SIG_SETMASK is defined.
$ ./test_c99
SIG_SETMASK is not defined.
Ken
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ‘SIG_SETMASK’ and -std=c99
2017-08-06 16:16 ` Ken Brown
@ 2017-08-06 17:00 ` Marco Atzeri
2017-08-06 20:43 ` Ken Brown
0 siblings, 1 reply; 7+ messages in thread
From: Marco Atzeri @ 2017-08-06 17:00 UTC (permalink / raw)
To: cygwin
On 06/08/2017 18:16, Ken Brown wrote:
> On 8/6/2017 10:51 AM, Marco Atzeri wrote:
>> On 06/08/2017 11:44, Achim Gratz wrote:
>>> The "-std=c*" options are not meant to expose any symbols that are not
>>> defined in the respective C standard. You almost always want to use
>>> "-std=gnu*" instead if you target POSIX-y systems.
>>
>> formally you are right. However it seems that Cygwin is now
>> more stringent than Linux where this problem does not arise.
>
> That's not what I see on Linux (Scientific Linux 7.2):
>
thanks Ken for the check.
I should have reported the full error
error: âSIG_SETMASKâ undeclared (first use in this function)
#define HDsigsetjmp(J,N) sigsetjmp(J,N)
from the macro definition in
/usr/include/machine/setjmp.h
It seems sigsetjmp is export anyway and using SIG_SETMASK
---------------------------------------------------
#ifdef __CYGWIN__
/* Per POSIX, siglongjmp has to be implemented as function. Cygwin
provides functions for both, siglongjmp and sigsetjmp since 2.2.0. */
extern void siglongjmp (sigjmp_buf, int) __attribute__ ((__noreturn__));
extern int sigsetjmp (sigjmp_buf, int);
#endif
#if defined(__GNUC__)
#define sigsetjmp(env, savemask) \
__extension__ \
({ \
sigjmp_buf *_sjbuf = &(env); \
((*_sjbuf)[_SAVEMASK] = savemask,\
__SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) +
_SIGMASK)),\
setjmp (*_sjbuf)); \
})
#define siglongjmp(env, val) \
__extension__ \
({ \
sigjmp_buf *_sjbuf = &(env); \
((((*_sjbuf)[_SAVEMASK]) ? \
__SIGMASK_FUNC (SIG_SETMASK, (sigset_t *)((*_sjbuf) +
_SIGMASK), 0)\
: 0), \
longjmp (*_sjbuf, val)); \
})
#else /* !__GNUC__ */
#define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
__SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *) ((env) +
_SIGMASK)),\
setjmp (env))
#define siglongjmp(env, val) ((((env)[_SAVEMASK])?\
__SIGMASK_FUNC (SIG_SETMASK, (sigset_t *) ((env) +
_SIGMASK), 0):0),\
longjmp (env, val))
#endif
------------------------------------------------------
hdf5 seems wrong to use sigsetjmp and C99 but Cygwin seems to
have a consistency issue.
Regards
Marco
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ‘SIG_SETMASK’ and -std=c99
2017-08-06 17:00 ` Marco Atzeri
@ 2017-08-06 20:43 ` Ken Brown
2017-08-06 21:49 ` Ken Brown
0 siblings, 1 reply; 7+ messages in thread
From: Ken Brown @ 2017-08-06 20:43 UTC (permalink / raw)
To: cygwin
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>
int
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);
^
Ken
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ‘SIG_SETMASK’ and -std=c99
2017-08-06 20:43 ` Ken Brown
@ 2017-08-06 21:49 ` Ken Brown
0 siblings, 0 replies; 7+ messages in thread
From: Ken Brown @ 2017-08-06 21:49 UTC (permalink / raw)
To: cygwin
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>
>
> int
> 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.
Ken
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-08-06 21:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-06 9:04 ‘SIG_SETMASK’ and -std=c99 Marco Atzeri
2017-08-06 9:44 ` Achim Gratz
2017-08-06 14:52 ` Marco Atzeri
2017-08-06 16:16 ` Ken Brown
2017-08-06 17:00 ` Marco Atzeri
2017-08-06 20:43 ` Ken Brown
2017-08-06 21:49 ` Ken Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).