[FFmpeg-devel] [PATCH] Implement the function cmdutils.c:parse_int_or_die

Michael Niedermayer michaelni
Wed Feb 20 14:56:53 CET 2008


On Wed, Feb 20, 2008 at 01:43:19PM -0000, M?ns Rullg?rd wrote:
> 
> Michael Niedermayer wrote:
> > On Wed, Feb 20, 2008 at 01:51:22AM -0500, D. Hugh Redelmeier wrote:
> >> Sure, but I claim that any values of type int or int64_t will of
> >> necessity (by way of guarantees in the C standard) be within the range
> >> [LLONG_MIN, LLONG_MAX].
> >
> > That is not true. Quoting the C spec:
> > --------
> >  minimum value for an object of type long long int
> >                     -9223372036854775807 // -(2^63 - 1)
> >  LLONG_MIN
> 
> You missed the part that says of these values:
> 
>   Their implementation-defined values shall be equal or greater in
>   magnitude (absolute value) to those shown, with the same sign.
> 
> It is perfectly legal for long long to be wider than 64 bits, but it
> must be at least 64 bits.

yes but it does not need to support
-9223372036854775808
while
int64_t must support it


> 
> > --------
> >  minimum values of exact-width signed integer types
> >                                            exactly -(2^(N-1) )
> >  INTN_MIN
> > --------
> 
> That bit isn't in my copy of the C99 standard, although I agree it is
> the only possible interpretation.

Its in mine (ISO-C-FDIS.1999-04.pdf)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080220/e31a5d4c/attachment.pgp>



More information about the ffmpeg-devel mailing list