[DVIPDFMx] %h[h]u and Solaris
Karl Berry
karl at freefriends.org
Wed Jun 9 09:21:40 KST 2010
Hi Peter -- thanks for fixing that declaration error, but it turns out
that %h is not supported at all on Solaris, according to the OP (msg and
test file duplicated below). On Solaris 10, I can confirm the core dump
with unsigned char. With unsigned short, it's ok -- but the Solaris 10
scanf(3) man page says %h is supported, so that's not surprising.
I hope to have access to a Solaris [89] box tomorrow/soon.
Anyway (Matthias/ChoF/all), do we need %h at all? Can we just switch
the variables to unsigned and use %u?
Thanks,
Karl
-----------------------------------------------------------------------------
Date: Tue, 8 Jun 2010 12:07:51 +0200 (CEST)
From: Peter Breitenlohner <peb at mppmu.mpg.de>
To: Karl Berry <karl at freefriends.org>
Hi Karl,
in r18536 (texk/dvipdfmx/src/pdfobj.c, l.2966 and 3011 you have changed
%hhu into %hu, but these refer to unsigned char variables.
The effect are compiler warnings and maybe buggy code on big endian.
A similar change in texk/dvipdfmx/src/dpxfile.c, l.729 yields no such
warning and probably also cases no problems (I'd assume due to argument
promotion). BTW: analogous code occurs in texk/xdvipdfmx/src/dpxfile.c,
l.752.
According to the posix sscanf manpage "hh" is the correct length specifier
for signed char or unsigned char.
If Solaris9 doesn't support %hhu, we'll have to use %hu but must then also
change the variable types to unsigned short!
Done in r18813. Please report upstream.
Regards
Peter
-----------------------------------------------------------------------------
Date: Sat, 29 May 2010 01:08:31 +0200
From: Ulrich Seidl <ulrich.seidl at gmail.com>
To: Karl Berry <karl at freefriends.org>, matthias at ktug.or.kr
CC: dvipdfmx at ktug.or.kr
Subject: Re: [DVIPDFMx] [ulrich.seidl: [tex-live] dvipdfmx on solaris9]
Hi there,
just tried the following:
#include <stdio.h>
int main ( int argc, int argv )
{
FILE *file;
unsigned char minor; /* ok with unsigned short on solaris 10 */
file = fopen( "/tmp/test.txt", "r");
rewind(file);
fscanf(file, "%hu", &minor);
return 0;
}
whereas "/tmp/test.txt" just contained a "4". Even though this works on
Linux, this leads to a Segmentation Fault on Solaris 9. Seems not to be
a viable solution. As already mentioned in the last mail, "%h" is not
available on Solaris 9.
Best regards,
Ulrich
More information about the dvipdfmx
mailing list