libio (?) problems for sparc-unknown-netbsd1.3.

Krister Walfridsson cato@df.lth.se
Tue Nov 18 13:32:00 GMT 1997


I have two problems with libio (from egcs-971114.tar.gz)

The first one is that 'make check' in libio fails, due to rdbz producing
corrupt *.dir files. This is because NetBSD/sparc are defining off_t as
long long. This is easy to fix with the following patch (to the files in
egcs-971114/libio/dbz)


--- dbz.c.old   Fri Aug 22 00:58:23 1997
+++ dbz.c       Tue Nov 18 20:21:00 1997
@@ -1198,14 +1198,17 @@
                DEBUG(("fseek failure in putconf\n"));
                ret = -1;
        }
-       fprintf(f, "dbz %d %ld %d %c %ld %ld %d %d", dbzversion, cp->tsize,
-                               cp->fieldsep, cp->casemap, cp->tagenb,
-                               cp->tagmask, cp->tagshift, cp->valuesize);
+       fprintf(f, "dbz %d %ld %d %c %ld %ld %d %d", dbzversion, 
+                               (long)cp->tsize,
+                               cp->fieldsep, cp->casemap, (long)cp->tagenb,
+                               (long)cp->tagmask, cp->tagshift,
+                                cp->valuesize);
        for (i = 0; i < cp->valuesize; i++)
                fprintf(f, " %d", cp->bytemap[i]);
        fprintf(f, "\n");
        for (i = 0; i < NUSEDS; i++)
-               fprintf(f, "%ld%c", cp->used[i], (i < NUSEDS-1) ? ' ' : '\n');
+               fprintf(f, "%ld%c",
+                       (long)cp->used[i], (i < NUSEDS-1) ? ' ' : '\n');
 
        (void) fflush(f);
        if (ferror(f))



bash$ diff -u dbzmain.c.old dbzmain.c
--- dbzmain.c.old       Fri Aug 22 00:58:23 1997
+++ dbzmain.c   Tue Nov 18 20:23:24 1997
@@ -278,7 +278,7 @@
        } else if (op == 'b' && dbzint) {
                if (!exact)
                        siz = dbzsize(siz);
-               if (dbzfresh(my_basename, siz, (int)fs, map, tag) < 0)
+               if (dbzfresh(my_basename, siz, (int)fs, map, (off_t)tag) < 0)
                        fail("dbzfresh(`%s'...) failed", my_basename);
        } else if (dbminit(my_basename) < 0)
                fail("dbminit(`%s') failed", my_basename);






But I still cannot run all tests in dbz. This time it fails when diffing
the two first run:

  [snip]
  ./rdbz -E 1000 -0 -p 2679 -t '  ' dbase2
  1000
  2000
  3000
  cmp hist3.3 dbase
  cmp dbase dbase2
  cmp dbase.dir dbase2.dir
  cmp dbase.pag dbase2.pag
  dbase.pag dbase2.pag differ: char 141, line 1
  gmake: *** [stamp-r2] Error 1


I think libio may be the culprit, since I have run the same tests where
I removed 'stdio.h', and thus used my normal libc functions, and everything
was OK. (And that indicates that I haven't forgotten to cast any off_t in
some other place.)

I have run all 'make check' thingies except those in dbz, and dejagnu
reports that all tests in libio passes, so there isn't any obvious error
there.

Does anybody have any suggestion where I should start too look now?


   /Krister





More information about the Gcc mailing list