[cfe-dev] Compiling FFmpeg

John Kelley jekelley at apple.com
Fri Dec 5 03:37:55 PST 2008


As mentioned in my last mail, clang has trouble compiling files that  
initialize struct members at declaration . One thing I forgot to  
mention is that clang still produces an object file even after the  
error. This allows make to continue as if everything is fine if it is  
run a second time.

- John

On Dec 5, 2008, at 3:21 AM, John Kelley wrote:

> To familiarize myself with clang I decided to try to compile FFmpeg as
> I am familiar with the project and the developers first guess when
> something goes wrong is "gcc is probably doing something stupid  
> again".
>
> This might seem like a lot to start off with and I'd tend to agree but
> less went wrong (so far) than I expected. The main issue thus far is
> that clang has trouble initializing structures. Below may not be the
> cleanest code but it was the simplest that I could find that produces
> an error:
>
> (from ffmpeg/libavutil/crc.c)
>
> typedef enum {
>     AV_CRC_8_ATM,
>     AV_CRC_16_ANSI,
>     AV_CRC_16_CCITT,
>     AV_CRC_32_IEEE,
>     AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of
> AV_CRC_32_IEEE */
>     AV_CRC_MAX,         /*< not part of public API! don't use outside
> lavu */
> }AVCRCId;
>
> static struct {
>     uint8_t  le;
>     uint8_t  bits;
>     uint32_t poly;
> } av_crc_table_params[AV_CRC_MAX] = {
>     [AV_CRC_8_ATM]      = { 0,  8,       0x07 },
>     [AV_CRC_16_ANSI]    = { 0, 16,     0x8005 },
>     [AV_CRC_16_CCITT]   = { 0, 16,     0x1021 },
>     [AV_CRC_32_IEEE]    = { 0, 32, 0x04C11DB7 },
>     [AV_CRC_32_IEEE_LE] = { 1, 32, 0xEDB88320 },
> };
>
> This produces the following error:
> crc.c:31:37: error: cannot codegen this initializer list with
> designators yet
> } av_crc_table_params[AV_CRC_MAX] = {
>                                     ^
>
> I have no problem pitching in to fix this but wanted to make sure that
> no one else is currently working on it and to ask where I should look
> to implement this.
>
> Also I was planning on taking a shot at the File Manager Speedup
> project listed in NOTES.txt unless there are any objections.
>
> Cheers,
> John Kelley
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list