[FFmpeg-devel] regression - mpeg2 interlace/topfield flags not set anymore

Rich Felker dalias
Mon Jan 28 13:10:27 CET 2008

On Mon, Jan 28, 2008 at 11:06:51AM +0100, Michel Bardiaux wrote:
> Are we 100% sure strtod *should* accept 0x1234? On linux debian etch the 
>   man page for strtod says this:
>         "A  hexadecimal  number consists of a ``0x'' or ``0X'' followed 
> by a nonempty sequence of hexadecimal digits possibly con-
>         taining a radix character, optionally followed by a binary 
> exponent. A binary exponent consists of a ``P'' or ``p'', fol-
>         lowed by an optional plus or minus sign, followed by a non-empty 
> sequence of decimal digits, and indicates multiplication
>         by a power of 2.  At least one of radix character and binary 
> exponent must be present."
> Seems to me 0x1234 is *not* legal since it contains neither radix nor 
> binary exponent...

You missed the word "optional".. :)

> Of course, man pages are not always the best source for standards!
> Note that the official MS (on-web0 doc states:
> "strtod expects nptr to point to a string of the following form:
> [whitespace] [sign] [digits] [.digits] [ {d | D | e | E}[sign]digits]
> A whitespace may consist of space and tab characters, which are ignored; 
> sign is either plus (+) or minus (?); and digits are one or more decimal 
> digits. If no digits appear before the radix character, at least one 
> must appear after the radix character. The decimal digits can be 
> followed by an exponent, which consists of an introductory letter (d, D, 
> e, or E) and an optionally signed integer. If neither an exponent part 
> nor a radix character appears, a radix character is assumed to follow 
> the last digit in the string. The first character that does not fit this 
> form stops the scan."
> So it may be a bit too strong to say its broken, its just C89-compliant 
> and not C9x, something MS made no mystery about.

I wouldn't be so quick to assume it even conforms to C89. The MS text
there is very poorly written; for example, what is "the first
character that does not fit this form" in the string "1.0e+"? The
correct way to specify and document behavior is with phrases like "the
largest initial substring that is of the form ...." or "the largest
initial substring that is also an initial substring of a string of the
form ..." etc.


More information about the ffmpeg-devel mailing list