Vladimir G. Ivanovic writes:
Mats,
Very nice. Thanks.
I applied your patches, but I still get these errors using
- ---with-xemacs-compiler=g++
Indeed. I get a build with the patch against a freshly updated CVS
below (the compiler.h hunk suppresses a slew of warnings, but isn't
absolutely necessary to build).
AFAICT *with the exception of the error in linuxplay.c* (sorry Mats,
you were right!) all of these are safe casts, as the void* is always
an int cast to a void* (this is a device for getting portability with
not quite standard compilers, I suppose). In the case of the
linuxplay.c size_t vs. int conflict, ISTR there was a patch for 21.4,
I thought it went into 21.5 too. Urk, it did, but it didn't fix the
variables themselves to be size_t, just removed the cast in the calls
to `parsesndfile' and `sndcnv'. Same in 21.4. :-(
I didn't need patches to the files below; I'm not sure why the
difference. Will investigate. Mats, any ideas? Maybe your LDAP
version is more up-to-date than Gentoo's?
> Index: modules/ldap/eldap.h
> Index: src/emacs.c
> Index: src/font-mgr.h
> Index: src/objects-tty.c
> Index: src/objects-xlike-inc.c
BTW, please report warnings, too! With the patch to compiler.h below,
the number of warnings is in the dozens; definitely cleanup is
thinkable.
Index: src/compiler.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/compiler.h,v
retrieving revision 1.11
diff -u -r1.11 compiler.h
--- src/compiler.h 26 Nov 2005 11:46:07 -0000 1.11
+++ src/compiler.h 30 May 2007 10:33:01 -0000
@@ -222,7 +222,7 @@
# define UNUSED_ARG(decl) unused_##decl
#endif
#ifndef UNUSED
-# if defined(__GNUC__) && !defined(__cplusplus) &&
!defined(__INTEL_COMPILER)
+# if defined(__GNUC__) && !defined(__INTEL_COMPILER)
# define ATTRIBUTE_UNUSED __attribute__ ((unused))
# else
# define ATTRIBUTE_UNUSED
Index: src/eval.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v
retrieving revision 1.96
diff -u -r1.96 eval.c
--- src/eval.c 26 May 2007 19:00:20 -0000 1.96
+++ src/eval.c 30 May 2007 10:33:02 -0000
@@ -6013,7 +6013,8 @@
val = XINT (lval);
else
{
- val = (int) get_opaque_ptr (lval);
+ /* if sizeof(EMACS_INT) > sizeof(int) this truncates the value */
+ val = (EMACS_INT) get_opaque_ptr (lval);
free_opaque_ptr (lval);
}
@@ -6032,10 +6033,13 @@
Lisp_Object opaque = make_opaque_ptr (addr);
Lisp_Object lval;
- if (NUMBER_FITS_IN_AN_EMACS_INT (val))
- lval = make_int (val);
- else
+#if SIZEOF_EMACS_INT == SIZEOF_INT
+ if (!NUMBER_FITS_IN_AN_EMACS_INT (val))
lval = make_opaque_ptr ((void *) val);
+ else
+#endif
+ lval = make_int (val);
+
return record_unwind_protect (restore_int, noseeum_cons (opaque, lval));
}
Index: src/event-unixoid.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-unixoid.c,v
retrieving revision 1.21
diff -u -r1.21 event-unixoid.c
--- src/event-unixoid.c 7 Feb 2003 11:50:53 -0000 1.21
+++ src/event-unixoid.c 30 May 2007 10:33:02 -0000
@@ -361,9 +361,10 @@
/* Decode inhandle and outhandle. Their meaning depends on
the process implementation being used. */
/* We are passed plain old file descs */
- infd = (int) inhandle;
- outfd = (int) outhandle;
- errfd = (int) errhandle;
+ /* if sizeof(EMACS_INT) > sizeof(int) this truncates the value */
+ infd = (EMACS_INT) inhandle;
+ outfd = (EMACS_INT) outhandle;
+ errfd = (EMACS_INT) errhandle;
*instream = (infd >= 0
? make_filedesc_input_stream (infd, 0, -1, 0)
Index: src/linuxplay.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/linuxplay.c,v
retrieving revision 1.21
diff -u -r1.21 linuxplay.c
--- src/linuxplay.c 19 May 2007 17:21:30 -0000 1.21
+++ src/linuxplay.c 30 May 2007 10:33:02 -0000
@@ -275,8 +275,9 @@
fmtType ffmt;
int fmt,speed,tracks;
void *pptr, *optr, *cptr, *sptr;
- int wrtn,rrtn,crtn,prtn;
- Binbyte sndbuf[SNDBUFSZ];
+ int wrtn, crtn;
+ size_t prtn, rrtn;
+ Binbyte sndbuf[SNDBUFSZ];
/* We need to read at least the header information before we can start
doing anything */
Index: src/process-unix.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v
retrieving revision 1.58
diff -u -r1.58 process-unix.c
--- src/process-unix.c 1 Apr 2006 16:21:11 -0000 1.58
+++ src/process-unix.c 30 May 2007 10:33:02 -0000
@@ -846,8 +846,9 @@
unix_init_process_io_handles (Lisp_Process *p, void *in, void *UNUSED (out),
void *err, int UNUSED (flags))
{
- UNIX_DATA(p)->infd = (int) in;
- UNIX_DATA(p)->errfd = (int) err;
+ /* if sizeof(EMACS_INT) > sizeof(int) this truncates the value */
+ UNIX_DATA(p)->infd = (EMACS_INT) in;
+ UNIX_DATA(p)->errfd = (EMACS_INT) err;
}
/* Move the file descriptor FD so that its number is not less than MIN. *
Index: src/sysdep.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.h,v
retrieving revision 1.22
diff -u -r1.22 sysdep.h
--- src/sysdep.h 25 Feb 2004 20:05:33 -0000 1.22
+++ src/sysdep.h 30 May 2007 10:33:02 -0000
@@ -26,10 +26,6 @@
#include <setjmp.h>
-#ifndef WIN32_NATIVE
-extern char **environ;
-#endif
-
#ifdef PDUMP
int pdump_read_file (char **pdump_start_pos, size_t *pdump_length);
#endif
@@ -67,6 +63,10 @@
void unrequest_sigio (void);
BEGIN_C_DECLS
+
+#ifndef WIN32_NATIVE
+extern char **environ;
+#endif
void stop_interrupts (void);
void start_interrupts (void);
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta