[fpc-pascal] Notice: Possible copyright infringements in FPC code base
Michael Van Canneyt
michael.vancanneyt at wisa.be
Mon Nov 19 10:38:11 CET 2007
The FPC team has been recently made aware that a number of routines in the
Classes unit are apparently based on code originally from Borland/CodeGear.
After someone found a tool to automatically compare source code bodies to look
for structural similarities, we improved its support for Object Pascal (it's in
svn now) and used it to compare all FPC RTL and FCL units with their Kylix 3
and Delphi 7 equivalents (in so far these exist).
This enabled us to find more cases where code may have originally come from or
be based on Delphi/Kylix code. All such identified routines of sufficient
complexity and/or likeliness have been or are in the process of being rewritten
from scratch using a clean room approach: by someone who is not intimately
familiar with the current implementation, and only based on documentation
written by other people. I am personally supervising this effort.
This whole issue highlights a quite annoying problem though: one the one hand,
it is most certainly our responsibility to ensure that all committed code can be
legally licensed under FPC's modified LGPL license, and in particular does not
originate from Delphi/Kylix sources. On the other hand, we have to avoid reading
Delphi/Kylix code as much as possible since by doing so, we may become "tainted"
ourselves and unconsciously start writing code which is based too closely on
As everyone knows, we nevertheless all try our best to avoid committing tainted
code, see e.g. the comments attached to the following bug reports:
And yet, from time to time it nevertheless happens anyway:
So this is one area where you, our users, can make a big difference and help us
in preventing this from happening in the future, as well as with notifying us as
soon as possible when it does happen (or when you know it happened in the past).
Most importantly: please ensure that you *never* submit patches based on code
copyrighted by third parties.
Let one thing be clear, however: none of the code that you wrote yourself can be
affected by this issue, as long as this code is not based on the tainted code
(whereby "based" means "based on their source code"; it does not mean, a.o.,
deriving from a tainted class, or calling a tainted routine -- in these cases
your own code is clean). Simply recompiling your program with an untainted
version of FPC will automatically clear your programs of any taint as well.
We are in a constructive dialog with people from CodeGear over this issue, and
will report back later on the repercussions as far as current and previous FPC
releases are concerned.
For the FPC Team,
PS: for those interested, here is the preliminary list of tainted routines we
have identified. If you are aware of more cases, please let us know as soon as
possible so we can evaluate them and put them in the queue for re-implementation!
* RemoveFixupReferences (RemoveFixups in Delphi),
* GetFixupInstanceNames (GetFixupReferenceNames in Delphi),
* TFPList.Assign (Kylix: tlist.assign)
* TFPList.Delete (Kylix: tlist.delete)
* Needs complete re-implementation (was taken from the net...)
More information about the fpc-pascal