2

I'm building a library and want to release it under MIT.

Among other functions, this library has to emulate the internal behaviour of std::unordered_set from libstdc++ (precisely -- determine the number of buckets by the number of elements). In order to do it I read the source code of libstdc++ and implemented the similar thing in my library. Also, there is a configuration file in libstdc++: a hard-coded list of 256 prime numbers which are potential hashtable sizes. It is not possible to emulate what I need without this list.

The main problem is that libstdc++ sources are released by GPL, which is not compatible with MIT this way.

I have two questions.

1) is it possible to put this hard-coded list into my code? Maybe I should claim that I produced it by interacting with unordered_set like a black box (it is possible) without looking at the source code explicitly.

2) is the part "I didn't copy your sources, I just implemented mine which do the same thing but do not share a line with yours" violating the license?

4

1) is it possible to put this hard-coded list into my code? Maybe I should claim that I produced it by interacting with unordered_set like a black box (it is possible) without looking at the source code explicitly.

In your specific context, the list in question is a list of prime numbers. In general I do not think such a short list of numbers would be eligible for copyright protection. Furthermore, based on the comments you posted, your own list is not copied from GCC but generated form a utility of yours.

As a side note, the libgo subsystem in GCC is BSD-licensed and there is a mention that the same primes list has been copied from the GCC i.e. from the same file. This is a potential, weak hint that Google and the Go developers may not consider this list of numbers as eligible for copyright protection (though they still slap their own license and copyright on top of their copy).

2) is the part "I didn't copy your sources, I just implemented mine which do the same thing but do not share a line with yours" violating the license?

Therefore in light of the above comment I think that you are fine in this context. That said if you still have concerns, the right thing to do would be to post a mail on the GCC mailing list to ask for further opinions about this.

  • Finally I decided to get the list from a black box to be 100% clean. At the moment I posted the question my source was a copy of GCC source with a link to it in the comments. However, your argument about libgo is fairly convincing. – Ivan Smirnov Jul 4 '17 at 23:17
  • Google tends to have a clear reading on what is copyrightable or not. Yet that does not mean they are immune to problems: see the Google vs. Oracle mess around Java ;) – Philippe Ombredanne Jul 5 '17 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.