[Hieroglyph] Building Hieroglyph by old gcc

mpsuzuki at hiroshima-u.ac.jp mpsuzuki at hiroshima-u.ac.jp
Sun Apr 2 16:59:39 PDT 2006


Hi

Sorry for my previous post in Japanese.

If I try to build Hieroglyph by older gcc-3.x,
it complains a few parts as they seem to use
uninitialized variables, although gcc-4.x does
not. Following is my fix, I wish it does not
change algorithm itself. At least, all "make check"
targets are passed.

diff -Burb hieroglyph.orig/hieroglyph/hgbtree.c hieroglyph/hieroglyph/hgbtree.c
--- hieroglyph.orig/hieroglyph/hgbtree.c	Wed Mar 29 20:04:18 2006
+++ hieroglyph/hieroglyph/hgbtree.c	Fri Mar 31 11:59:46 2006
@@ -575,7 +575,7 @@
 		   gpointer key)
 {
 	HgBTreePage *page, *prev = NULL;
-	int i;
+	int i = 0;
 
 	g_return_val_if_fail (tree != NULL, NULL);
 
diff -Burb hieroglyph.orig/hieroglyph/hgmem.c hieroglyph/hieroglyph/hgmem.c
--- hieroglyph.orig/hieroglyph/hgmem.c	Wed Mar 29 20:04:17 2006
+++ hieroglyph/hieroglyph/hgmem.c	Fri Mar 31 12:03:17 2006
@@ -141,6 +145,7 @@
 	    read(fd, stat_buffer, STAT_BUFSIZE) < 2 * STAT_SKIP) {
 		g_error("Failed to read /proc/self/stat");
 	} else {
+		extern int *__libc_stack_end;
 		c = stat_buffer[offset++];
 		for (i = 0; i < STAT_SKIP; i++) {
 			while (isspace(c)) c = stat_buffer[offset++];
@@ -156,7 +161,6 @@
 		if (result < 0x10000000)
 			g_error("the stack bottom may be invalid: %x.", result);
 		_hg_stack_start = (gpointer)result;
-		extern int *__libc_stack_end;
 		/* FIXME: the above code somehow doesn't work on valgrind */
 		_hg_stack_start = __libc_stack_end;
 	}
diff -Burb hieroglyph.orig/libretto/operator.c hieroglyph/libretto/operator.c
--- hieroglyph.orig/libretto/operator.c	Wed Mar 29 20:03:48 2006
+++ hieroglyph/libretto/operator.c	Fri Mar 31 12:00:54 2006
@@ -1619,7 +1625,7 @@
 {
 	LibrettoStack *ostack = libretto_vm_get_ostack(vm);
 	guint depth = libretto_stack_depth(ostack);
-	HgValueNode *node;
+	HgValueNode *node = NULL;
 	HgMemPool *pool = libretto_vm_get_current_pool(vm);
 	gint32 i;
 
--

BTW, yet I could not build Hieroglyph by more older
gcc (gcc-2.9x.y). For example, gcc-2.95.3 complains
another part like this:

$ gcc-2.95.3 -DHAVE_CONFIG_H -I. -I. -I.. \
	-DG_LOG_DOMAIN=\"Hieroglyph\" \
	-DHIEROGLYPH_DEVICEDIR=\"/usr/local/lib/hieroglyph/0.0/devices\" \
	-DHIEROGLYPH_FILTERDIR=\"\" -DHIEROGLYPH_CMAPDIR=\"\" \
	-I/usr/local/gtk28/include/glib-2.0 \
	-I/usr/local/gtk28/lib/glib-2.0/include \
	-I/usr/local/include -I/kiyomizu/gtk28/include/glib-2.0 \
	-I/usr/local/gtk28/lib/glib-2.0/include \
	-I/usr/local/include \
	-g -O2 -Wall -Werror -c hgarray.c -Wp,-MD,.deps/hgarray.TPlo \
	-fPIC -DPIC -o .libs/hgarray.lo

In file included from hgarray.h:27,
                 from hgarray.c:29:
../hieroglyph/hgtypes.h:224: field `data' has incomplete type
make[2]: *** [hgarray.lo] Error 1

   217  struct _HieroGlyphMemObject {
   218          gint32     id;
   219          gpointer   subid;
   220          glong      heap_id;
   221          HgMemPool *pool;
   222          gsize      block_size;
   223          guint      flags;
   224          gpointer   data[];	<----- here
   225  };



More information about the Hieroglyph mailing list