On Sun, Jul 30, 2017 at 03:47:39PM -0300, James Almer wrote: > On 7/30/2017 5:25 AM, Clément Bœsch wrote: > > On Sun, Jul 30, 2017 at 04:34:16AM +0200, Michael Niedermayer wrote: > > [...] > >>> + struct font_tag stack[16] = {0}; > >> > >> this seems to produce a compiler warning: > >> > >> ./libavcodec/htmlsubtitles.c: In function ‘ff_htmlmarkup_to_ass’: > >> ./libavcodec/htmlsubtitles.c:112:12: warning: missing braces around > >> initializer [-Wmissing-braces] > >> > > > > Ah, I don't have that warning. Changed locally with a memset 0 (and of > > only the first element this time). > > You could try moving char "face[128]" to the end of the font_tag struct. > That should in theory also get rid of the warning. > Could you confirm that, Michael?.
seems this very minor warning issue led to a much bigger discussion than i expected ... this is one way to fix the warning: - struct font_tag stack[16] = {0}; + struct font_tag stack[16] = {{{0}}}; this is another: diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c index 69d855df21..1950ddf54c 100644 --- a/libavcodec/htmlsubtitles.c +++ b/libavcodec/htmlsubtitles.c @@ -65,9 +65,9 @@ static void handle_open_brace(AVBPrint *dst, const char **inp, int *an, int *clo } struct font_tag { - char face[128]; int size; uint32_t color; + char face[128]; }; /* @@ -105,7 +105,7 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in) * remaining after the opening one was dropped. Yes, this happens and we * still don't want to print a "</b>" at the end of the dialog event. */ - struct font_tag stack[16] = {0}; + struct font_tag stack[16] = {{0}}; for (; !end && *in; in++) { switch (*in) I did not test these with other compilers, but i can if someone see value in it [...] -- 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
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel