From: David Given Date: Wed, 29 May 2013 13:48:51 +0000 (+0100) Subject: Attempt to fix 64-bitness error in ashow. Deprecate the structure format macros in... X-Git-Tag: release-6-0-pre-5~20 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6fff2d45fece78dad2389b443cde3e0d24e44fac;p=ack.git Attempt to fix 64-bitness error in ashow. Deprecate the structure format macros in h/out.h because they make no sense on 64-bit platforms. --- diff --git a/h/out.h b/h/out.h index 122296f8e..0dffd2908 100644 --- a/h/out.h +++ b/h/out.h @@ -100,13 +100,19 @@ struct outname { /* * structure format strings */ +#if 0 +/* The following strings only make sense on 32-bit platforms, so we're going + * to try and deprecate them. */ #define SF_HEAD "22222244" #define SF_SECT "44444" #define SF_RELO "1124" #define SF_NAME "4224" +#endif /* - * structure sizes (bytes in file; add digits in SF_*) + * structure sizes on disk (bytes in file; add digits in SF_*) + * Note! These are NOT the sizes in memory (64-bit architectures will have + * a different layout). */ #define SZ_HEAD 20 #define SZ_SECT 20 diff --git a/util/amisc/ashow.c b/util/amisc/ashow.c index 5f22827ee..809937d71 100644 --- a/util/amisc/ashow.c +++ b/util/amisc/ashow.c @@ -70,7 +70,7 @@ show(headp) /* * We get all struct outname's and the strings in core first. */ - name = (struct outname *) myalloc(headp->oh_nname * SZ_NAME); + name = (struct outname *) myalloc(headp->oh_nname * sizeof(struct outname)); string = myalloc((unsigned) headp->oh_nchar); rd_name(name, headp->oh_nname); for (np = &name[0]; np < &name[headp->oh_nname]; np++) {