[FFmpeg-devel] Various small fixes

Anders Grönberg galileo.m2
Sat Dec 13 20:31:02 CET 2008


On Sat, Dec 13, 2008 at 8:06 PM, Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:
> On Sat, 2008-12-13 at 18:17 +0100, Anders Gr?nberg wrote:
>> 6.9.2 - External object definitions
>
>> ?3 If the declaration of an identifier for an object is a tentative
>> definition and has internal
>> linkage, the declared type shall not be an incomplete type.
>
> This does seem to prohibit declarations of static arrays before knowing
> their size. That has some impractical consequences. It forces either
> moving the initializer above the code using the array or counting the
> number of entries in the initializer to be able to write a complete
> declaration with the correct size (and then having two places to change
> if entries are added or deleted). If you have two static arrays
> initialized to contain pointers to each other then moving the code in
> any order won't work.
Maybe something like this, good compilers should at least give you a
warning if the array is too small.
But it's not as clean as the current code.
#define options_ARRAY_SIZE 56
static const OptionDef options[options_ARRAY_SIZE];
//code
static const OptionDef options[options_ARRAY_SIZE] = {};

>
> I wonder what the reason for such a clumsy requirement is. Support for
> really primitive one-pass compilers that make up the static variable
> memory layout as they encounter them? But since they need to handle
> global variables anyway that seems pointless.
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list