Problem with building PDFs

Jeff Johnston jjohnstn@redhat.com
Wed May 1 21:22:00 GMT 2013


On 05/01/2013 04:40 PM, Freddie Chopin wrote:
> W dniu 2013-05-01 22:10, Jeff Johnston pisze:
>> Ok, let's go back a few steps.
>>
>> I am able to build the pdf and info targets fine.
>>
>> I am using Fedora 17 with the following packages:
>>
>> texinfo-4.13a-16.fc17.x86_64
>> texinfo-tex-4.13a-16.fc17.x86_64
>> texlive-2007-70.fc17.x86_64
>>
>> Can you please post to the texinfo mailing list to see if they have made
>> any recent changes they think would cause the issue you are seeing?
>>
>> If there is something we are doing wrong, we can certainly look at
>> altering the newlib/doc/doc.str file (e.g. removing the @* at the end of
>> a bodytext:).
>>
>> -- Jeff J.
>
> Well, I'm certain that recent release of texinfo 5 caused many trouble
> to various opensource projects like GCC, binutils etc.:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56258
> http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1113210.html
>
> http://sourceware-org.1504.n7.nabble.com/RFA-fix-gdb-texinfo-for-Texinfo-5-0-td222958.html
>
> etc.
> This matter is "fresh" - patches for these projects are 1-2 months old,
> there aren't probably many distros that use texlive 5 right now...
>
> The strange thing is that I started to have problems with newlib pdfs
> before release of texinfo 5 /; So the problem with html (and info) is
> definitely related to texinfo 5, but the problem with PDF - ? ...
>
> Currently I have (in Arch x64):
> texinfo 5.1-1
> texi2html 5.0-2
> texlive 2012.0-10
>
> As for the problems with PDF - I consider that this may be my fault,
> problem of my system or sth else - but something completely not related
> to newlib itself.
>
> This particular issue (pdf) is probably not related to texinfo at all,
> as when I started having these problems I still had 4.13a - just a
> different package/build than when it was working for me, but still
> 4.13a. This is probably not related to texlive too, as it was (and still
> is) version 2012...
>
> Could you please send me one of generated .def files for one of 5
> problematic files - like sscanf.def? I'd like to check whether I'm
> getting identical result as you (if that's possible).
>

Attached.

> 4\/3!!

-------------- next part --------------
@node sscanf
@section @code{sscanf}, @code{fscanf}, @code{scanf}---scan and format input
@findex scanf
@findex _scanf_r
@findex fscanf
@findex _fscanf_r
@findex sscanf
@findex _sscanf_r
@strong{Synopsis}
@example
#include <stdio.h>

int scanf(const char *@var{format}, ...);
int fscanf(FILE *@var{fd}, const char *@var{format}, ...);
int sscanf(const char *@var{str}, const char *@var{format}, ...);

int _scanf_r(struct _reent *@var{ptr}, const char *@var{format}, ...);
int _fscanf_r(struct _reent *@var{ptr}, FILE *@var{fd}, 
    const char *@var{format}, ...);
int _sscanf_r(struct _reent *@var{ptr}, const char *@var{str},
    const char *@var{format}, ...);

@end example
@strong{Description}@*
@code{scanf} scans a series of input fields from standard input,
one character at a time.  Each field is interpreted according to
a format specifier passed to @code{scanf} in the format string at
@code{*@var{format}}.  @code{scanf} stores the interpreted input from
each field at the address passed to it as the corresponding argument
following @var{format}.  You must supply the same number of
format specifiers and address arguments as there are input fields.

There must be sufficient address arguments for the given format
specifiers; if not the results are unpredictable and likely
disasterous.  Excess address arguments are merely ignored.

@code{scanf} often produces unexpected results if the input diverges from
an expected pattern. Since the combination of @code{gets} or @code{fgets}
followed by @code{sscanf} is safe and easy, that is the preferred way
to be certain that a program is synchronized with input at the end
of a line.

@code{fscanf} and @code{sscanf} are identical to @code{scanf}, other than the
source of input: @code{fscanf} reads from a file, and @code{sscanf}
from a string.

The routines @code{_scanf_r}, @code{_fscanf_r}, and @code{_sscanf_r} are reentrant
versions of @code{scanf}, @code{fscanf}, and @code{sscanf} that take an additional
first argument pointing to a reentrancy structure.

The string at @code{*@var{format}} is a character sequence composed
of zero or more directives. Directives are composed of
one or more whitespace characters, non-whitespace characters,
and format specifications.

Whitespace characters are blank (@code{ }), tab (@code{\t}), or
newline (@code{\n}).
When @code{scanf} encounters a whitespace character in the format string
it will read (but not store) all consecutive whitespace characters
up to the next non-whitespace character in the input.

Non-whitespace characters are all other ASCII characters except the
percent sign (@code{%}).  When @code{scanf} encounters a non-whitespace
character in the format string it will read, but not store
a matching non-whitespace character.

Format specifications tell @code{scanf} to read and convert characters
from the input field into specific types of values, and store then
in the locations specified by the address arguments.

Trailing whitespace is left unread unless explicitly
matched in the format string.

The format specifiers must begin with a percent sign (@code{%})
and have the following form:

@smallexample
       %[*][@var{width}][@var{size}]@var{type}
@end smallexample

Each format specification begins with the percent character (@code{%}).
The other fields are:
@table @code

@item *
an optional marker; if present, it suppresses interpretation and
assignment of this input field.

@item @var{width}
an optional maximum field width: a decimal integer,
which controls the maximum number of characters that
will be read before converting the current input field.  If the
input field has fewer than @var{width} characters, @code{scanf}
reads all the characters in the field, and then
proceeds with the next field and its format specification.

If a whitespace or a non-convertable character occurs
before @var{width} character are read, the characters up
to that character are read, converted, and stored.
Then @code{scanf} proceeds to the next format specification.

@item size
@code{h}, @code{j}, @code{l}, @code{L}, @code{t}, and @code{z} are optional size
characters which override the default way that @code{scanf}
interprets the data type of the corresponding argument.

@smallexample
Modifier   Type(s)
   hh      d, i, o, u, x, n  convert input to char,
                             store in char object

   h       d, i, o, u, x, n  convert input to short,
                             store in short object

   h       D, I, O, U, X     no effect
           e, f, c, s, p

   j       d, i, o, u, x, n  convert input to intmax_t,
                             store in intmax_t object

   j       all others        no effect

   l       d, i, o, u, x, n  convert input to long,
                             store in long object

   l       e, f, g           convert input to double
                             store in a double object

   l       D, I, O, U, X     no effect
           c, s, p

   ll      d, i, o, u, x, n  convert to long long,
                             store in long long

   L       d, i, o, u, x, n  convert to long long,
                             store in long long

   L       e, f, g, E, G     convert to long double,
                             store in long double

   L       all others        no effect

   t       d, i, o, u, x, n  convert input to ptrdiff_t,
                             store in ptrdiff_t object

   t       all others        no effect

   z       d, i, o, u, x, n  convert input to size_t,
                             store in size_t object

   z       all others        no effect

@end smallexample

@item @var{type}

A character to specify what kind of conversion
@code{scanf} performs.  Here is a table of the conversion
characters:

@table @code

@item  %
No conversion is done; the percent character (@code{%}) is stored.

@item c
Scans one character.  Corresponding @var{arg}: @code{(char *arg)}.

@item s
Reads a character string into the array supplied.
Corresponding @var{arg}: @code{(char arg[])}.

@item  [@var{pattern}]
Reads a non-empty character string into memory
starting at @var{arg}.  This area must be large
enough to accept the sequence and a
terminating null character which will be added
automatically.  (@var{pattern} is discussed in the paragraph following
this table). Corresponding @var{arg}: @code{(char *arg)}.

@item d
Reads a decimal integer into the corresponding @var{arg}: @code{(int *arg)}.

@item D
Reads a decimal integer into the corresponding
@var{arg}: @code{(long *arg)}.

@item o
Reads an octal integer into the corresponding @var{arg}: @code{(int *arg)}.

@item O
Reads an octal integer into the corresponding @var{arg}: @code{(long *arg)}.

@item u
Reads an unsigned decimal integer into the corresponding
@var{arg}: @code{(unsigned int *arg)}.
@item U
Reads an unsigned decimal integer into the corresponding @var{arg}:
@code{(unsigned long *arg)}.

@item x,X
Read a hexadecimal integer into the corresponding @var{arg}:
@code{(int *arg)}.

@item e, f, g
Read a floating-point number into the corresponding @var{arg}:
@code{(float *arg)}.

@item E, F, G
Read a floating-point number into the corresponding @var{arg}:
@code{(double *arg)}.

@item  i
Reads a decimal, octal or hexadecimal integer into the
corresponding @var{arg}: @code{(int *arg)}.

@item  I
Reads a decimal, octal or hexadecimal integer into the
corresponding @var{arg}: @code{(long *arg)}.

@item  n
Stores the number of characters read in the corresponding
@var{arg}: @code{(int *arg)}.

@item  p
Stores a scanned pointer.  ANSI C leaves the details
to each implementation; this implementation treats
@code{%p} exactly the same as @code{%U}.  Corresponding
@var{arg}: @code{(void **arg)}.  
@end table


A @var{pattern} of characters surrounded by square brackets can be used
instead of the @code{s} type character.  @var{pattern} is a set of
characters which define a search set of possible characters making up
the @code{scanf} input field.  If the first character in the brackets is a
caret (@code{^}), the search set is inverted to include all ASCII characters
except those between the brackets.  There is also a range facility
which you can use as a shortcut. @code{%[0-9] } matches all decimal digits.
The hyphen must not be the first or last character in the set.
The character prior to the hyphen must be lexically less than the
character after it.

Here are some @var{pattern} examples:
@table @code

@item %[abcd]
matches strings containing only @code{a}, @code{b}, @code{c}, and @code{d}.

@item %[^abcd]
matches strings containing any characters except @code{a}, @code{b},
@code{c}, or @code{d}

@item %[A-DW-Z]
matches strings containing @code{A}, @code{B}, @code{C}, @code{D}, @code{W},
@code{X}, @code{Y}, @code{Z}

@item %[z-a]
matches the characters  @code{z}, @code{-}, and @code{a}
@end table


Floating point numbers (for field types @code{e}, @code{f}, @code{g}, @code{E},
@code{F}, @code{G}) must correspond to the following general form:

@smallexample
		[+/-] ddddd[.]ddd [E|e[+|-]ddd]
@end smallexample

where objects inclosed in square brackets are optional, and @code{ddd}
represents decimal, octal, or hexadecimal digits.
@end table


@*
@strong{Returns}@*
@code{scanf} returns the number of input fields successfully
scanned, converted and stored; the return value does
not include scanned fields which were not stored.

If @code{scanf} attempts to read at end-of-file, the return
value is @code{EOF}.

If no fields were stored, the return value is @code{0}.

@code{scanf} might stop scanning a particular field before
reaching the normal field end character, or may
terminate entirely.

@code{scanf} stops scanning and storing the current field
and moves to the next input field (if any)
in any of the following situations:

@itemize @bullet

@item       The assignment suppressing character (@code{*}) appears
after the @code{%} in the format specification; the current
input field is scanned but not stored.

@item       @var{width} characters have been read (@var{width} is a
width specification, a positive decimal integer).

@item       The next character read cannot be converted
under the the current format (for example,
if a @code{Z} is read when the format is decimal).

@item       The next character in the input field does not appear
in the search set (or does appear in the inverted search set).
@end itemize


When @code{scanf} stops scanning the current input field for one of
these reasons, the next character is considered unread and
used as the first character of the following input field, or the
first character in a subsequent read operation on the input.

@code{scanf} will terminate under the following circumstances:

@itemize @bullet

@item       The next character in the input field conflicts
with a corresponding non-whitespace character in the
format string.

@item       The next character in the input field is @code{EOF}.

@item       The format string has been exhausted.
@end itemize


When the format string contains a character sequence that is
not part of a format specification, the same character
sequence must appear in the input; @code{scanf} will
scan but not store the matched characters.  If a
conflict occurs, the first conflicting character remains in the input
as if it had never been read.

@*
@strong{Portability}@*
@code{scanf} is ANSI C.

Supporting OS subroutines required: @code{close}, @code{fstat}, @code{isatty},
@code{lseek}, @code{read}, @code{sbrk}, @code{write}.

@*


More information about the Newlib mailing list