64bit capability bug

Amos info-cyrus at utdallas.edu
Thu Dec 30 23:31:54 EST 2004


I'm seeing the same thing on Solaris 8, 9, and 10 (s10_69) using a 
not so old cc (-xarch=v9 option) and gcc 3.3.3 (-m64). These are all 
on sparc boxes. I got non-zero values by changing 'int' to 'long'.

Amos
-------------- next part --------------
--- test.c	2004-12-30 22:09:33.793048000 -0600
+++ test2.c	2004-12-30 22:21:34.297308000 -0600
@@ -1,6 +1,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#define MY_INT long
+
 enum opttype {
   OPT_STRINGLIST,
   OPT_ENUM,
@@ -194,9 +196,9 @@
 
        const char *s;
 
-       int i;
+       MY_INT i;
 
-       int b;
+       MY_INT b;
 
        enum enum_value e;
 
@@ -216,7 +218,7 @@
 
     const char *optname;
 
-    int seen;
+    MY_INT seen;
 
     union config_value val;
 
@@ -395,7 +397,7 @@
 };
 
 
-int config_getint(enum imapopt opt)
+MY_INT config_getint(enum imapopt opt)
 {
 
     return imapopts[opt].val.i;
@@ -409,7 +411,7 @@
 
 
 int main() {
-	int opt;
+	MY_INT opt;
 	for( opt=IMAPOPT_ZERO; opt<IMAPOPT_LAST; opt++) {
 		if(imapopts[opt].t == OPT_INT) {
 			printf("%s=%d\n", imapopts[opt].optname, config_getint(opt));


More information about the Info-cyrus mailing list