Re: Error compiling nhc98-1.02 in RHL 7



About this list Date view Thread view Subject view Author view

Malcolm Wallace (malcolm-nhc@cs.york.ac.uk)
Fri, 16 Feb 2001 11:18:34 +0000


> Should nhc rely on these details? fpos_t is an opaque type in ISO/ANSI C. > For positions expressed in a character count there are functions like > fseek and ftell working on unsigned long, Ah, now I see. I mistakenly believed that fseek() and ftell() were deprecated in favour of fgetpos() and fsetpos(). It turns out that byte-counts are exactly what I want, so I should return to the older functions. Thank you. I've attached a patch, which is also available from the website. Regards, Malcolm ----cut here---- diff -u nhc98-1.02/src/tracer/runtime/ident.c nhc98-1.02x/src/tracer/runtime/ident.c --- nhc98-1.02/src/tracer/runtime/ident.c Thu Feb 15 11:51:36 2001 +++ nhc98-1.02x/src/tracer/runtime/ident.c Fri Feb 16 11:00:26 2001 @@ -59,7 +59,7 @@ void dumpNewModInfo (FILE *dumpfile, ModInfo *modinfo) { - fpos_t mypos, idpos; + FileOffset mypos, idpos; int i=0; if (modinfo->fileoffset) { @@ -70,7 +70,7 @@ } /* dump this module info */ - fgetpos(dumpfile,&mypos); + mypos = ftell(dumpfile); mypos = htonl(mypos); /* ensure network byte-ordering */ fprintf(dumpfile,"%c%s%c%s%c", 0x20 ,modinfo->modname, 0x0, modinfo->srcfile, 0x0); @@ -80,7 +80,7 @@ { IdEntry *id = modinfo->idtable; while (id->constr != 0) { - fgetpos(dumpfile,&idpos); + idpos = ftell(dumpfile); idpos = htonl(idpos); /* ensure network byte-ordering */ fputc(0x46,dumpfile); fwrite(id->name, sizeof(char), 1+strlen(id->name), dumpfile); @@ -89,7 +89,7 @@ } else { fprintf(stderr,"IDENTRY: %s (module %s not dumped)\n" ,id->name,id->srcmod->modname); - fwrite(&mypos, sizeof(fpos_t), 1, dumpfile); + fwrite(&mypos, sizeof(FileOffset), 1, dumpfile); } fputc((char)id->pri,dumpfile); i = htonl(id->srcpos);


About this list Date view Thread view Subject view Author view