[FFmpeg-devel] compile error for few days
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Mon Jul 2 07:51:54 CEST 2012
On 1 Jul 2012, at 13:56, Alexander Strasser <eclipse7 at gmx.net> wrote:
>> */
>> 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.
No, I only complain about the ridiculousness of these very useful features still not being included in C++ and an argument why you really should not be using such a crap language as C++ but in very exceptional circumstances.
I occasionally grow soft on people insisting otherwise though.
> 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.
If you want to avoid it, just change "make test" to push all public headers through gcc in C++ mode (with the extern "C" and a few defines we already require around it).
Nobody will care if its just guidelines not backed by a test anyway.
More information about the ffmpeg-devel
mailing list