[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cyrus-devel
Subject:    Re: compiling problems with forte CC
From:       Jeremy Rumpf <jrumpf () heavyload ! net>
Date:       2003-06-16 14:15:30
[Download RAW message or body]

On Monday 16 June 2003 10:00 am, Voutsinas Nikos wrote:
> I tried to build cyrus-sasl with SUN forte compiler and I faced the
> following errors, which are passed correctly by gcc.
>
> "./cache.h", line 99: syntax error before or at: /
> "./cache.h", line 99: invalid source character: '#'
> "./cache.h", line 99: undefined or not a type: define
>
> "cache.c", line 133: cannot do pointer arithmetic on operand of unknown
> size
>
> "utils.c", line 116: cannot do pointer arithmetic on operand of unknown
> size "utils.c", line 153: cannot do pointer arithmetic on operand of
> unknown size
>
> "ipc_unix.c", line 49: invalid directive
>
> I have assigned a patch that fixes those errors.  Please note that I
> have not checked wether those changes have been included in the current
> cvs branch. In such a case, please forgive me.
>
> Nikos Voutsinas

The following is in CVS to performe some of the ANSI C cleanups needed above. 

Thanks,
Jeremy



["cyrus-sasl-2.1.13-ansi.patch" (text/x-diff)]

diff -u -r cyrus-sasl-2.1.13.orig/saslauthd/cache.c cyrus-sasl-2.1.13/saslauthd/cache.c
--- cyrus-sasl-2.1.13.orig/saslauthd/cache.c	Wed May 14 14:51:41 2003
+++ cyrus-sasl-2.1.13/saslauthd/cache.c	Wed May 14 15:00:28 2003
@@ -130,14 +130,14 @@
 	memset(base, 0, bytes);
 
 	memcpy(base, cache_magic, 64);
-	table_stats = base + 64;
+	table_stats = (void *)((char *)base + 64);
 	table_stats->table_size = table_size;
 	table_stats->max_buckets_per = CACHE_MAX_BUCKETS_PER;
 	table_stats->sizeof_bucket = sizeof(struct bucket);
 	table_stats->timeout = table_timeout;
 	table_stats->bytes = bytes;
 
-	(char *)table = (char *)table_stats + 128;
+	table = (void *)((char *)table_stats + 128);
 
 	/**************************************************************
 	 * Last, initialize the hash table locking.
diff -u -r cyrus-sasl-2.1.13.orig/saslauthd/cache.h cyrus-sasl-2.1.13/saslauthd/cache.h
--- cyrus-sasl-2.1.13.orig/saslauthd/cache.h	Wed May 14 14:51:41 2003
+++ cyrus-sasl-2.1.13/saslauthd/cache.h	Wed May 14 14:52:06 2003
@@ -96,7 +96,7 @@
 
 
 /* If debugging uncomment this for always verbose  */
-//#define CACHE_DEFAULT_FLAGS		CACHE_VERBOSE
+/* #define CACHE_DEFAULT_FLAGS		CACHE_VERBOSE */
 
 
 
diff -u -r cyrus-sasl-2.1.13.orig/saslauthd/ipc_doors.c cyrus-sasl-2.1.13/saslauthd/ipc_doors.c
--- cyrus-sasl-2.1.13.orig/saslauthd/ipc_doors.c	Wed May 14 14:51:41 2003
+++ cyrus-sasl-2.1.13/saslauthd/ipc_doors.c	Wed May 14 15:03:38 2003
@@ -47,7 +47,6 @@
 #include "saslauthd-main.h"
 
 #ifdef USE_DOORS_IPC
-#warning compiling in doors ipc
 /****************************************/
 
 
diff -u -r cyrus-sasl-2.1.13.orig/saslauthd/ipc_unix.c cyrus-sasl-2.1.13/saslauthd/ipc_unix.c
--- cyrus-sasl-2.1.13.orig/saslauthd/ipc_unix.c	Wed May 14 14:51:41 2003
+++ cyrus-sasl-2.1.13/saslauthd/ipc_unix.c	Wed May 14 15:03:07 2003
@@ -46,7 +46,6 @@
 #include "saslauthd-main.h"
 
 #ifdef USE_UNIX_IPC
-#warning compiling in unix ipc
 /****************************************/
 
 /****************************************
diff -u -r cyrus-sasl-2.1.13.orig/saslauthd/saslauthd-main.c cyrus-sasl-2.1.13/saslauthd/saslauthd-main.c
--- cyrus-sasl-2.1.13.orig/saslauthd/saslauthd-main.c	Wed May 14 14:51:41 2003
+++ cyrus-sasl-2.1.13/saslauthd/saslauthd-main.c	Wed May 14 15:09:01 2003
@@ -311,7 +311,7 @@
 	/*********************************************************
 	 * Enable general cleanup.
 	 **********************************************************/
-	atexit((void *)server_exit);
+	atexit(server_exit);
 
 	/*********************************************************
 	 * If required, enable the process model.
@@ -485,7 +485,7 @@
 	/**************************************************************
 	 * Handler for SIGCHLD
 	 **************************************************************/
-	act_sigchld.sa_handler = (void *)handle_sigchld;
+	act_sigchld.sa_handler = handle_sigchld;
 	sigemptyset(&act_sigchld.sa_mask);
 
 	if (sigaction(SIGCHLD, &act_sigchld, NULL) != 0) {
@@ -537,7 +537,7 @@
 	/**************************************************************
 	 * Handler for SIGTERM
 	 **************************************************************/
-	act_sigterm.sa_handler = (void *)server_exit;
+	act_sigterm.sa_handler = server_exit;
 	sigemptyset(&act_sigterm.sa_mask);
 
 	if (sigaction(SIGTERM, &act_sigterm, NULL) != 0) {
@@ -550,7 +550,7 @@
 	/**************************************************************
 	 * Handler for SIGINT
 	 **************************************************************/
-	act_sigint.sa_handler = (void *)server_exit;
+	act_sigint.sa_handler = server_exit;
 	sigemptyset(&act_sigint.sa_mask);
 
 	if (sigaction(SIGINT, &act_sigint, NULL) != 0) {
diff -u -r cyrus-sasl-2.1.13.orig/saslauthd/utils.c cyrus-sasl-2.1.13/saslauthd/utils.c
--- cyrus-sasl-2.1.13.orig/saslauthd/utils.c	Wed May 14 14:51:41 2003
+++ cyrus-sasl-2.1.13/saslauthd/utils.c	Wed May 14 15:02:46 2003
@@ -113,7 +113,7 @@
                         return(bytesrequested - bytesleft);
 
                 bytesleft -= bytesio;
-                buff += bytesio;
+                buff = (void *)((char *)buff + bytesio);
 
         }
 
@@ -150,7 +150,7 @@
                         return(bytesrequested - bytesleft);
 
                 bytesleft -= bytesio;
-                buff += bytesio;
+                buff = (void *)((char *)buff + bytesio);
 
         }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic