Re: armv7 main's gpart [show]: signal 11 core dump during boot, before login; xo_format_string_direct; official pkgbase distribution (kernel and world)

Mark Millard <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm,gmane.os.freebsd.current
Message-ID <[email protected]>
I've found a problem: use of %ld notation which is not an
invariant match to off_t and the like across FreeBSD
platforms: off_t is 64 bits across FreeBSD platoforms
but long is not (and so %ld is not):

+ xo_emit("=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n",
. . .
+ xo_emit(" {t:start/%*jd} {t:sectors/%*jd} {P:/%*s} {ne:free}- free - ({h:size/%ld})\n",
. . . 
+ xo_emit(" ({h:size/%ld})\n", pp->lg_mediasize);
. . .
+ xo_emit(" {t:start/%*jd} {t:sectors/%*jd} {P:/%*s} {ne:free}- free - ({h:size/%ld})\n",

%ld is for long but:

. . .
           Architecture   long   void *   long double   time_t
           aarch64        8      8        16            8
           aarch64c       8      16       16            8
           amd64          8      8        16            8
           armv7          4      4        8             8
           i386           4      4        12            4
. . .

The code would be broken in this way for i386 as well.



===
Mark Millard
marklmi at yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.