[FFmpeg-devel] [PATCH][RFC] -std=c99

Måns Rullgård mans
Thu Aug 21 17:39:10 CEST 2008


Luca Abeni wrote:
> Hi Aurelien,
>
> Aurelien Jacobs wrote:
> [...]
>>>> 4) I believe that adding "#define _BSD_SOURCE" at the top of udp.c (before
>>>>     all the "#include"s) should fix the compilation (can anyone test? I do
>>>>     not see the compilation failure, so I cannot test). And asking fro BSD
>>>>     compatibility when using sockets looks like a good idea, so I think
>>>>     this could be an acceptable solution...
>>>>
>>>> Ideas/comments?
>>> It seems this is the only sensible option we have.  The one thing I don't
>>> like about it is that by messing with reserved namespace (_BSD_SOURCE),
>>> we are invoking undefined behaviour. There is no telling what some other
>>> libc might do if this is defined.  In reality, the risk of something nasty
>>> happening is probably quite low.
>>
>> Another solution is probably to define _SVID_SOURCE.
>
> Yes, I think that would work too. Another option could be defining
> _GNU_SOURCE...

For the love of all that is holy, and some that is not, don't do that.

> I proposed _BSD_SOURCE because I see sockets as a BSD thing, but I am ok
> with any of the three possibilities.
> So, if:
> 1) someone can confirm that defining one of the three symbols mentioned above
>     fixes the build
> 2) there is an agreement on the symbol that is better to define
> 3) noone is against the fix
> then I'd like to commit the fix in few days.

With glibc, one of the three proposed preprocessor symbols must be defined.
Of these, I prefer _BSD_SOURCE, admittedly for vague reasons.  It should
be used only this file, of course.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list