>>>> AA == Adrian Aichner writes:
AA> temacs
crashes during build when using
AA> DEBUG_XEMACS=0
AA> ERROR_CHECK_ALL=0
If DEBUG_XEMACS is not defined, the parameter of an assert() is not
executed.
This causes a problem in intl-win32.c: In function
unicode_multibyte_convert_size the variable active_alloca_convert gets
initialized only in a function call which is inside of an assert. Without
DEBUG_XEMACS, the function is not called and the variable is not
initialized. An assignment to the uninitialized variable later crashes.
AA> See also compilation warnings at end.
The ones with MALLOC_BEGIN get also fixed by this patch.
src/ChangeLog addition:
2005-03-13 Marcus Crestani <crestani(a)informatik.uni-tuebingen.de>
Fix native Windows build if DEBUG_XEMACS is not defined.
* alloc.c (MALLOC_BEGIN): Remove unused parameter.
* intl-win32.c (unicode_multibyte_convert_size): Move function
call out of assert.
xemacs-test source patch:
Diff command: cvs -q diff -u
Files affected: src/intl-win32.c src/alloc.c
Index: src/alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v
retrieving revision 1.108
diff -u -r1.108 alloc.c
--- src/alloc.c 11 Mar 2005 08:42:36 -0000 1.108
+++ src/alloc.c 13 Mar 2005 00:59:30 -0000
@@ -349,7 +349,7 @@
#else /* ERROR_CHECK_MALLOC */
-#define MALLOC_BEGIN(block)
+#define MALLOC_BEGIN()
#define FREE_OR_REALLOC_BEGIN(block)
#define MALLOC_END()
Index: src/intl-win32.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-win32.c,v
retrieving revision 1.14
diff -u -r1.14 intl-win32.c
--- src/intl-win32.c 24 Jan 2005 23:34:00 -0000 1.14
+++ src/intl-win32.c 13 Mar 2005 00:59:35 -0000
@@ -1972,8 +1972,9 @@
Bytecount src_size, int to_unicode, int cp)
{
alloca_convert_vals vals;
-
- assert (find_pos_of_existing_active_alloca_convert (srctext) < 0);
+
+ int pos = find_pos_of_existing_active_alloca_convert (srctext);
+ assert (pos < 0);
vals.srctext = srctext;
--
Marcus