[Ffmpeg-devel] Re: [PATCH] Dead code cleanup - C++
Stefan Heinzmann
stefan_heinzmann
Tue Jan 30 17:35:20 CET 2007
John Dalgliesh wrote:
>> Waiting for a version number increment sounds like a good idea though,
>> as this patch will of course break linkage in C++ client code which
>> doesn't have its own extern "C" {}.
>
> There's no point in doing that. The version numbers are defined inside
> the very headers we're talking about, so there's no way to base your
> decision on whether or not to add 'extern "C"' on these version
> numbers... by the time you know it's too late!
>
> This will be one that C++ people just have to find and fix. And actually
> it's not necessary to detect older versions because, as has already been
> pointed out, nested linkage specifications are permitted.
>
> And seeing as how it doesn't break binary compatibility, IMHO it could
> be done anytime.
The point in waiting for a version number bump is not merely or even
mainly the possibility to autodetect anything using #ifdef. This would
be pointless here, but not for the reason you mention, since
unconditionally adding the linkage specification externally will work,
whether they are also present in the header or not. It is the same as
with all other interface changes that may break user's builds. You
normally would expect such breaking changes only if they are accompanied
with a new version number. I's a basic predictability guarantee, if
nothing more.
Of course if you don't care about breaking builds, do anything you like!
Cheers
Stefan
More information about the ffmpeg-devel
mailing list