[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r8372 - branches/1.0-stabilization

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-01-18 19:41:27 CET

On Sun, 2004-01-18 at 09:17, Philip Martin wrote:
> The way to handle it is an autoconf macro (perhaps for AIX/xlc only)
> that attempts to compile volatile sig_atomic_t.

If we do want to go this route, here's a patch. (I have no particular
emotional attachment to it, but I'm one of the relatively few people in
the project who does do autoconf.)

* configure.in: Add a test for whether "volatile sig_atomic_t" compiles.
* subversion/svnadmin/main.c (cancelled),
  subversion/svnlook/main.c (cancelled),
  subversion/clients/cmdline/main.c (cancelled): Use svn__sigvar_t
   in case "volatile sig_atomic_t" doesn't compile.

Index: configure.in
===================================================================
--- configure.in (revision 8375)
+++ configure.in (working copy)
@@ -297,6 +297,20 @@
 dnl if non-existent, define size_t to be `unsigned'
 AC_TYPE_SIZE_T
 
+dnl AIX 5.1's xlc yields an error on "volatile sig_atomic_t",
+dnl complaining of a duplicate volatile qualifier. C99 section 7.14
+dnl does allow (but not require) sig_atomic_t to be volatile-
+dnl qualified, but section 7.14.1.1 explicitly requires global
+dnl variables modified by signal handlers to be declared "volatile
+dnl sig_atomic_t", so the compiler is at fault. Work around this
+dnl problem by testing whether a "volatile sig_atomic_t" declaration
+dnl will compile properly.
+AC_MSG_CHECKING([signal variable type])
+AC_TRY_COMPILE([#include <signal.h>], [volatile sig_atomic_t foo;],
+ [svn_sigvar="volatile sig_atomic_t"], [svn_sigvar=sig_atomic_t])
+AC_DEFINE_UNQUOTED(svn__sigvar_t, $svn_sigvar,
+ [Define to the type for global variables modified by signal handlers.])
+AC_MSG_RESULT($svn_sigvar)
 
 dnl Check for library functions ----------
 
Index: subversion/svnadmin/main.c
===================================================================
--- subversion/svnadmin/main.c (revision 8375)
+++ subversion/svnadmin/main.c (working copy)
@@ -30,13 +30,14 @@
 #include "svn_config.h"
 #include "svn_repos.h"
 #include "svn_fs.h"
+#include "svn_private_config.h"
 
 
 
 /*** Code. ***/
 
 /* A flag to see if we've been cancelled by the client or not. */
-static volatile sig_atomic_t cancelled = FALSE;
+static svn__sigvar_t cancelled = FALSE;
 
 /* A signal handler to support cancellation. */
 static void
Index: subversion/svnlook/main.c
===================================================================
--- subversion/svnlook/main.c (revision 8375)
+++ subversion/svnlook/main.c (working copy)
@@ -43,6 +43,7 @@
 #include "svn_opt.h"
 #include "svn_props.h"
 #include "svn_diff.h"
+#include "svn_private_config.h"
 
 
 /*** Some convenience macros and types. ***/
@@ -229,7 +230,7 @@
 } svnlook_ctxt_t;
 
 /* A flag to see if we've been cancelled by the client or not. */
-static volatile sig_atomic_t cancelled = FALSE;
+static svn__sigvar_t cancelled = FALSE;
 
 
 /*** Helper functions. ***/
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (revision 8375)
+++ subversion/clients/cmdline/main.c (working copy)
@@ -45,6 +45,7 @@
 #include "svn_time.h"
 #include "svn_utf.h"
 #include "svn_auth.h"
+#include "svn_private_config.h"
 #include "cl.h"
 
 
@@ -608,7 +609,7 @@
 
 
 /* A flag to see if we've been cancelled by the client or not. */
-static volatile sig_atomic_t cancelled = FALSE;
+static svn__sigvar_t cancelled = FALSE;
 
 /* A signal handler to support cancellation. */
 static void

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 18 19:42:13 2004

This is an archived mail posted to the Subversion Dev mailing list.