public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE
@ 2017-08-07 12:43 Ken Brown
  2017-08-07 14:09 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Ken Brown @ 2017-08-07 12:43 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

sigsetjmp and siglongjmp are POSIX extensions but are not properly 
guarded in machine/setjmp.h.  This leads to the problem reported here:

    https://cygwin.com/ml/cygwin/2017-08/msg00060.html

Patch attached.

Ken

[-- Attachment #2: 0001-Define-sigsetjmp-siglongjmp-only-if-__POSIX_VISIBLE.patch --]
[-- Type: text/plain, Size: 939 bytes --]

From 50cceaf0e1d33ddf3fc62399bc15761af93fa29d Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Sun, 6 Aug 2017 17:40:43 -0400
Subject: [PATCH] Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE

---
 newlib/libc/include/machine/setjmp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 2b4dd8b91..e6c3142ed 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -368,7 +368,7 @@ typedef	int jmp_buf[_JBLEN];
 
 _END_STD_C
 
-#if defined(__CYGWIN__) || defined(__rtems__)
+#if (defined(__CYGWIN__) || defined(__rtems__)) && __POSIX_VISIBLE
 #include <signal.h>
 
 #ifdef __cplusplus
@@ -450,4 +450,4 @@ extern int _setjmp (jmp_buf);
 #ifdef __cplusplus
 }
 #endif
-#endif /* __CYGWIN__ or __rtems__ */
+#endif /* (__CYGWIN__ or __rtems__) and __POSIX_VISIBLE */
-- 
2.13.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE
  2017-08-07 12:43 Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE Ken Brown
@ 2017-08-07 14:09 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2017-08-07 14:09 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]

On Aug  7 08:43, Ken Brown wrote:
> sigsetjmp and siglongjmp are POSIX extensions but are not properly guarded
> in machine/setjmp.h.  This leads to the problem reported here:
> 
>    https://cygwin.com/ml/cygwin/2017-08/msg00060.html
> 
> Patch attached.
> 
> Ken

> From 50cceaf0e1d33ddf3fc62399bc15761af93fa29d Mon Sep 17 00:00:00 2001
> From: Ken Brown <kbrown@cornell.edu>
> Date: Sun, 6 Aug 2017 17:40:43 -0400
> Subject: [PATCH] Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE
> 
> ---
>  newlib/libc/include/machine/setjmp.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
> index 2b4dd8b91..e6c3142ed 100644
> --- a/newlib/libc/include/machine/setjmp.h
> +++ b/newlib/libc/include/machine/setjmp.h
> @@ -368,7 +368,7 @@ typedef	int jmp_buf[_JBLEN];
>  
>  _END_STD_C
>  
> -#if defined(__CYGWIN__) || defined(__rtems__)
> +#if (defined(__CYGWIN__) || defined(__rtems__)) && __POSIX_VISIBLE
>  #include <signal.h>
>  
>  #ifdef __cplusplus
> @@ -450,4 +450,4 @@ extern int _setjmp (jmp_buf);
>  #ifdef __cplusplus
>  }
>  #endif
> -#endif /* __CYGWIN__ or __rtems__ */
> +#endif /* (__CYGWIN__ or __rtems__) and __POSIX_VISIBLE */
> -- 
> 2.13.2
> 

Pushed.


Thanks,
Corinna


-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-07 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 12:43 Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE Ken Brown
2017-08-07 14:09 ` Corinna Vinschen

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).