>>>> "SJT" == Stephen J Turnbull
<turnbull(a)sk.tsukuba.ac.jp> writes:
>>>> "Stephen" == Stephen J Turnbull
<turnbull(a)sk.tsukuba.ac.jp> writes:
Stephen> Dunno; does this tell you
anything?
SJT> Sorry, it was late (it's later now...). I can read `info gcc', really
SJT> I can....
SJT> -Wsign-compare
SJT> **** Executive summary:
SJT> Martin: the data destruction _was_ your bug (identified as yours by
SJT> lack of a ChangeLog, and being in the same CVS diff as a Martin
SJT> mega-patch that was in the ChangeLog, 1998-03-22, eliminate MAC_*
SJT> macros). That is the only one in lstream.c, though.
I'll take responsibility for this bug, but I'll also point out that by
trying to advocate -Wsign-compare-correctness, you are encouraging the
sort of patch that is likely to introduce this kind of bug.
Nevertheless, just to be weird, I provide a sample patch of exactly that kind:
Index: src/ChangeLog
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.154.2.882
diff -u -w -U0 -r1.154.2.882 ChangeLog
--- src/ChangeLog 2001/02/16 13:38:04 1.154.2.882
+++ src/ChangeLog 2001/02/16 14:19:12
@@ -0,0 +1,6 @@
+2001-02-17 Martin Buchholz <martin(a)xemacs.org>
+
+ * alloc.c (Fgarbage_collect):
+ * alloc.c (make_bit_vector_from_byte_vector):
+ -Wsign-compare-correctness.
+
Index: src/alloc.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/alloc.c,v
retrieving revision 1.42.2.78
diff -u -w -r1.42.2.78 alloc.c
--- src/alloc.c 2001/02/07 05:56:47 1.42.2.78
+++ src/alloc.c 2001/02/16 14:19:28
@@ -1315,7 +1315,7 @@
Lisp_Object
make_bit_vector_from_byte_vector (unsigned char *bytevec, size_t length)
{
- int i;
+ size_t i;
Lisp_Bit_Vector *p = make_bit_vector_internal (length);
for (i = 0; i < length; i++)
@@ -3533,7 +3533,7 @@
())
{
Lisp_Object pl = Qnil;
- int i;
+ unsigned int i;
int gc_count_vector_total_size = 0;
garbage_collect_1 ();
@@ -3548,7 +3548,7 @@
const char *name = lrecord_implementations_table[i]->name;
int len = strlen (name);
/* save this for the FSFmacs-compatible part of the summary */
- if (i == lrecord_vector.lrecord_type_index)
+ if (i == lrecord_type_vector)
gc_count_vector_total_size =
lcrecord_stats[i].bytes_in_use + lcrecord_stats[i].bytes_freed;