Compiling FFmpeg

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

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

This is a bug! I cannot reproduce however:

Hi John,

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".

Great! We love having clang run over more code.

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:

clang doesn't currently support designated initializers. This is PR2749:
http://llvm.org/bugs/show_bug.cgi?id=2749

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.

I do not believe anyone is working on this. You might profitably
search the mailing list archives for "designators" or "designated
initializers" to find previous discussions on the topic. gmane is
useful for this:
http://news.gmane.org/gmane.comp.compilers.clang.devel

- Daniel