[FFmpeg-devel] compile error for few days

Alexander Strasser eclipse7 at gmx.net
Sun Jul 1 13:56:36 CEST 2012


Hi,

Geek.Song wrote:
> On Sun, Jul 1, 2012 at 1:52 PM, Masaru Nomiya <nomiya at galaxy.dti.ne.jp> wrote:
[problem report skipped]
> try this patch:
> 
> Index: intfloat.h
> ===================================================================
> --- intfloat.h	(revision 3492)
> +++ intfloat.h	(revision 3856)
> @@ -39,7 +39,12 @@

  Hmm, revision dddd ? No, function context info in @@ chunk header line?

>   */
>  static av_always_inline float av_int2float(uint32_t i)
>  {
> +#ifdef __cplusplus
> +    union av_intfloat32 v;
> +    v.i = i;
> +#else
>      union av_intfloat32 v = { .i = i };
> +#endif
>      return v.f;
>  }

  I do not think it makes sense to keep both versions.

  Also I am not sure how often we export inline functions that contain
C99 specific features in public API, like in this case designated
initializers for aggregate/union types.

  IIRC Reimar complained from time to time to not use C99 features that
did not get into the very recent C++ standard in public headers. I am
personally thinking alike. Maybe we should come up with some guide lines
about this. E.g. if it is in a macro it might be ok to expose it as it
won't trigger compile errors when used from C++ assuming that macro is
not used by the client source code.

  I realize that this problem is triggered inside an internal C++ module
of FFmpeg and not by a non-FFmpeg application that uses libavutil as a
client. But as the header is public AFAICT it could also trigger problems
in external libavutil clients.

  Just thinking out loud. Comments appreciated.

  Alexander


More information about the ffmpeg-devel mailing list