15

A while ago, I encountered an edit suggestion on Stack Overflow. The OP had posted a snippet that was under the GPL, and included the GPL in the snippet. The editor tried to remove the GPL as it was not relevant to the question.

From an SE point of view, this makes sense - as an SO user, I don't want to see licenses, just the code that the question is about.

Is it legal to remove the license this way, assuming the snippet is a non-trivial piece of code?

3

3 Answers 3

16
  1. If the code snippet is is authored by user, then adding the GPL just means that it is dual licensed under the GNU GPL as well as CC BY-SA (the default licence applied to all content posted on SE). This was mighty helpful of the user, as it would otherwise not be possible to reuse that snippet in any program not licensed under CC BY-SA without finding it elsewhere under GPL.

  2. If the code snippet was not authored by SE user, and the code was was not too trivial to be uncopyrightable, and its original licence was GPL, then posting it on SE would put it under CC BY-SA. However, only the original author can do this, so such an action without permission from the copyright owner would be unlawful.

1
  • 1
    "then posting it on SE would put it under CC BY-SA" -- or rather, it wouldn't put it under CC BY-SA (because the person posting has no legal ability to do so). Therefore unless there's "fair use" the poster is breaching firstly the GPL (by redistributing without the license) and secondly the terms of the site (by posting without being able to grant the necessary licenses). Furthermore the site is unknowingly in breach of the GPL by redistributing without the license. Again, unless there's fair use. Aug 10, 2015 at 18:16
9

If the code snippet was actually just a snippet, then you could see it as a citation of the original source code and as long as the citation was necessary to enable people to comment properly, it may fall under Fair Use. Since Fair Use is an exception to copyright coverage, the license would not matter much in this case as long as the source it publicly available. Countries that do not have the concept of Fair Use in their copyright legislation sometimes have specific exceptions for citations.

It is hard to judge if it was clearly just a citation without seeing the actual post.

2
  • I refrained from linking the actual edit suggestion to focus on the more general case, and to avoid drawing undue attention to the post itself. If we need a specific example, I can still edit it in. Aug 9, 2015 at 18:53
  • 6
    @S.L.Barth Fair Use is tricky and treacherous. It would all depend on the context, and even then we wouldn't be able to give a conclusive answer; it's always for the court to decide. That said, if the post was critiquing or commenting on the snipped, it's likelier a fair use defense would help than if the post was offering the snippet as a solution. Context matters a lot in fair use.
    – Martijn
    Aug 9, 2015 at 21:51
7

This was contrary to the T&C of stackoverflow.

You agree that all Subscriber Content that You contribute to the Network is perpetually and irrevocably licensed to Stack Exchange under the Creative Commons Attribution Share Alike license.

The author granted a CC license whether or not they posted a GPL notice. If the author lacked rights to grant that license, the whole post is invalid. So either the GPL goes, or the post goes. So, it's legal insofar as, under the T&Cs of the site, posting the code granted the CC license, and so the GPL notice was misleading noise.

If the author not only added the GPL notice, but clearly stated that his or her intent was to dual-license both GPL and CC, then it would be reasonable, if kind of pretentious and noisy. But if the impression is that the OP is trying to avoid the CC license in favor of the GPL, it's no go.

Meanwhile, some legal experts apply de minimus to small software snippets. On the other hand, if the author is specifically claiming the snippet as a copyrighted work, it's probably not a good idea to pick a fight.

1
  • It is actually very helpful to dual license the code if the person asking the question (or anyone else) intents to use the code in a GPL software. This would otherwise be illegal or at least a grey area. For exactly this reason all my code snippets are dual licensed with CC0 (see my Profile)
    – Josef
    Aug 10, 2015 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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