delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/27/03:36:13

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49CC8FE7.8090904@users.sourceforge.net>
Date: Fri, 27 Mar 2009 03:35:51 -0500
From: "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] <signal.h> does not compile with -ansi
References: <49CAFB8B DOT 7090909 AT users DOT sourceforge DOT net> <49CB0834 DOT 3010904 AT gmail DOT com> <49CB0F4A DOT 908 AT users DOT sourceforge DOT net>
In-Reply-To: <49CB0F4A.908@users.sourceforge.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------040408020409020706060906
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Yaakov (Cygwin/X) wrote:
> Actually, it looks like someone already thought about that, but never
> enabled it.  There is a commented-out #ifndef __STRICT_ANSI__ which
> excludes about half of sys/signal.h.  *UNTESTED* patch attached.

That doesn't work, because we need the _sig_func_ptr typedef regardless
of -ansi:

/usr/include/signal.h:17: error: expected ',' or ';' before '_signal_r'
/usr/include/signal.h:21: error: expected ',' or ';' before 'signal'

Take two attached.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAknMj+cACgkQpiWmPGlmQSMdvgCfY2m10bjOBb8nr9lnzIjucxuS
+EoAoOuRLRe7/8OfhuK2Mz3zfQSn3hCe
=Ez8A
-----END PGP SIGNATURE-----

--------------040408020409020706060906
Content-Type: text/x-patch;
 name="newlib-ansi-signal.h.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="newlib-ansi-signal.h.patch"

Index: libc/include/sys/signal.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/signal.h,v
retrieving revision 1.18
diff -u -r1.18 signal.h
--- libc/include/sys/signal.h	18 Apr 2006 20:06:09 -0000	1.18
+++ libc/include/sys/signal.h	27 Mar 2009 08:22:15 -0000
@@ -9,7 +9,13 @@
 #include "_ansi.h"
 #include <sys/features.h>
 
-/* #ifndef __STRICT_ANSI__*/
+#if defined(__rtems__)
+typedef void (*_sig_func_ptr)();
+#else
+typedef void (*_sig_func_ptr)(int);
+#endif
+
+#ifndef __STRICT_ANSI__
 
 #if defined(_POSIX_THREADS)
 #include <sys/types.h>   /* for pthread data types */
@@ -83,8 +89,6 @@
  *      application should not use both simultaneously.
  */
 
-typedef void (*_sig_func_ptr)();
-
 struct sigaction {
   int         sa_flags;       /* Special flags to affect behavior of signal */
   sigset_t    sa_mask;        /* Additional set of signals to be blocked */
@@ -108,8 +112,6 @@
 #else
 #define SA_NOCLDSTOP 1  /* only value supported now for sa_flags */
 
-typedef void (*_sig_func_ptr)(int);
-
 struct sigaction 
 {
 	_sig_func_ptr sa_handler;
@@ -187,7 +189,7 @@
 
 #endif /* defined(__CYGWIN__) || defined(__rtems__) */
 
-/* #endif __STRICT_ANSI__ */
+#endif /* __STRICT_ANSI__ */
 
 #if defined(___AM29K__)
 /* These all need to be defined for ANSI C, but I don't think they are

--------------040408020409020706060906
Content-Type: text/x-patch;
 name="cygwin-ansi-signal.h.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cygwin-ansi-signal.h.patch"

Index: include/cygwin/signal.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/signal.h,v
retrieving revision 1.17
diff -u -r1.17 signal.h
--- include/cygwin/signal.h	11 Sep 2008 06:22:31 -0000	1.17
+++ include/cygwin/signal.h	27 Mar 2009 08:34:48 -0000
@@ -190,8 +190,6 @@
 					   perform notification */
 };
 
-typedef void (*_sig_func_ptr)(int);
-
 struct sigaction
 {
   __extension__ union
Index: include/sys/select.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/sys/select.h,v
retrieving revision 1.3
diff -u -r1.3 select.h
--- include/sys/select.h	19 Apr 2005 08:32:59 -0000	1.3
+++ include/sys/select.h	27 Mar 2009 08:34:48 -0000
@@ -12,7 +12,7 @@
 #ifndef _SYS_SELECT_H
 #define _SYS_SELECT_H
 
-#if !defined (_POSIX_SOURCE) && !defined (__INSIDE_CYGWIN_NET__)
+#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && !defined (__INSIDE_CYGWIN_NET__)
 
 #include <sys/cdefs.h>
 


--------------040408020409020706060906
Content-Type: text/plain; charset=us-ascii

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019