Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've recently run into some argument with a person that claims to be a lawyer (I have my suspicions about this not being completely true, though).

As far as I know, copying even one line of code from GPLed program into proprietary body of code requires you to release the whole thing under GPL, if you ever decide to publish the software and make it available to the public.

The person in question claims that it is "absurd" (I know it is, but AFAIK that's how GPL works), it is "redefining the copyright", "GPL has no power to do that", and claiming that "one line of GPLed code makes you release the whole thing under GPL" is absurd. That contradicts the GPL FAQ.

Can somebody clarify the situation? Am I right in assumption that copying even smallest subroutine from GPL program into your code automatically makes your program a "derived work" which means you are obliged to release it under GPL license if you publish it?

share|improve this question

migrated from stackoverflow.com Nov 14 '11 at 8:27

This question came from our site for professional and enthusiast programmers.

Only one line? Good luck to establish the evidence. –  mouviciel Nov 14 '11 at 8:32
This isn't actually a software license question. If the new work is a "derived work" from a GPLed original, it needs to be under the GPL. If not, then copyright and hence the GPL don't apply. The question is, specifically, whether the new work is a derived work according to the definitions used in copyright law. IANAL, but I really doubt that copying one line is sufficient, under copyright law, to make a program a "derived work". You should consult a lawyer to see how much you can likely take from a GPLed program without making a derived work. –  David Thornley Nov 14 '11 at 16:22
@mouviciel Google lost over 9 lines out of millions... –  SnakeDoc Mar 25 '14 at 17:17
I just sold some code which contained a line that said i++; Should I be worried? –  Mawg Nov 28 '14 at 15:33
@Mawg: You should be, since it indicates possibility of poor coding style. In most cases iterator name should be descriptive and self-explanatory, such as "nameIndex". "i" is pretty much acceptable only in very short for loops, in which case it doesn't get a line for itself, or when it is used in mathematical sense and actually means "i". Also, the question was asked 3 years ago. Accepted answer covers legal part of your query. –  SigTerm Nov 29 '14 at 11:18

4 Answers 4

up vote 14 down vote accepted

I am not a lawyer either, but I've read a bit.

It may depend on the line. Not every line is necessarily independently copyrightable. So the line would have to fulfil the requirements of originality and creativity required. Some types of code (eg API's) are required for compatibility and to date have been found to be not copyrightable.

Think of it like this. A telephone directory can be copyrighted as the creative act is the compilation and arrangement of names and numbers. An individual name and number is not necessarily copyrightable (by the directory compilers).

Taking entire sub routines may well cause the GPL to take effect.

If you have a specific question, ask a lawyer.


As cpast points out below, telephone directories are not copyrightable in the USA, though the general priciple that a line of code would have to satisfy the requirements of originality still stands.

share|improve this answer
Just what I was about to say, but better formulated. +1. –  larsmans Nov 13 '11 at 19:04
Another obvious example: The line { is not copyrightable. It's in your program to satisfy C rules, not to express a creative idea. –  MSalters Nov 14 '11 at 12:28
Well It work like that in my contry, but not especially in all contries. This question is locale specific. –  deadalnix Nov 14 '11 at 16:17
Good catch deadalnix. Although much of this stuff is pretty transferable (Through things like the Berne convention, WIPO treaty 1996 and TRIPS ) not all of it is and local interpretations may vary. As I wrote, best to ask a lawyer if there is a specific question. –  Jaydee Nov 14 '11 at 16:42
A telephone directory cannot be copyrighted in all countries (specifically, in the US, "collect all numbers in this area" isn't creative). The standards for what can be copyrighted most certainly differ from place to place. –  cpast Nov 27 '14 at 23:14

Short version:

Probably. Ask a lawyer to be sure.

Long version:

The key part of this question boils down to "what amount of code is protectable under copyright?" That's what the GPL is founded on - copyright protections. If you can't copyright something, then the GPL can't protect it.

Fortunately, there's a paper that was written by the Software Freedom Law Center titled Originality Requirements under U.S. and E.U. Copyright Law that goes into this with much greater detail that I, as a programmer, can properly interpret. You will likely need to ask a lawyer.

That said, and I'm going to preface this with "I'm only remotely familiar with US copyright law", I am going to go into the "is a single line of code copyrightable" which in turn will answer the "does one line of GPL'ed code make the entire work a derivative work?" If you have any doubts about my answer (and you should) and that this is something important (you've got some code), you should instead talk to a lawyer. Note that different thresholds exist in different countries which may mean that something that a contributor wrote in a different country may be copyrighted even though if you wrote the same thing in your country it wouldn't.

That said, it appears that the Software Copyright Directive from the European Community in 1991 unified the copyright standards across European Community. This had the effect of bringing the laws closer to that of the United States interpretations for originality.

A computer program shall be protected if it is original in the sense that it is the author's own intellectual creation. No other criteria shall be applied to determine its eligibility for protection.

One of the key parts of copyright law is the threshold of originality (though note that some places work on the sweat of the brow doctrine - the US law specifically rejects this). The creativity element is a very low bar and easily passed (you can read more about that at Feist Publications, Inc., v. Rural Telephone Service Co.)

While it is a very low bar, it is not non-existent:

An author’s expression does not need to “be presented in an innovative or surprising way,” but it “cannot be so mechanical or routine as to require no creativity whatsoever.” A work that it is “entirely typical,” “garden-variety,” or “devoid of even the slightest traces of creativity” does not satisfy the originality requirement. Feist, 499 U.S. at 362. “[T]here is nothing remotely creative” about a work that merely reflects “an age-old practice, firmly rooted in tradition and so commonplace that it has come to be expected as a matter of course.” Id. at 363. Likewise, a work “does not possess the minimal creative spark required by the Copyright Act” if the author’s expression is “obvious” or “practically inevitable.” Id. at 363.

Although the creativity standard is low, it is not limitless. Id. at 362. “There remains a narrow category of works in which the creative spark is utterly lacking or so trivial as to be virtually nonexistent. Such works are incapable of sustaining valid copyright.” Id. at 359 (citations omitted)

Further reading about this at Compendium: Chapter 300 Copyrightable Authorship: What Can Be Registered. The originality requirement is section 308.

And so, from this, I would conclude that while i = 0; is not copyrightable, and thus something that will not cause the work to be a derived work, anything more complex could be and thus firmly in the realm of lawyers to battle it out. One line of code from a GPL'ed source may very well be enough to cause the entire work to fall under the GPL as a derived work. If this is an issue, ask a lawyer.

share|improve this answer

Copyright law is quite specific in allowing "quotes" or small extracts from works to be included in other works.

How small is a matter of much case law but four of five lines could easily be quoted without any danger of violating copyright.

share|improve this answer

The key point here is that this does not force your whole program to become a derived work.

The conditions you agree to when using GPL v3 code is that should you wish to release the software to a third party in binary form you must now also include the parts of your code that derive directly from the GPL code.

This does not mean you must open source your whole program, only the derived parts.

For instance, if you include a single line of code in a library that makes up a part of your codebase you could easily create a single open source library containing that one line and have your program link with it at runtime.

If you decide not to split it into parts that can be distributed separately and replaced by the end user then as I understand it, you are in violation of the GPL.

share|improve this answer
-1: GPL explicitly makes the whole program including all dependencies (except system libraries) a derived work if any piece of it is derived. You must open-source the whole program and even 3rd party dependencies that are not obtainable otherwise! –  Jan Hudec Nov 14 '11 at 9:01
This is in fact a description of the Lesser General Public License (LPGL). –  MSalters Nov 14 '11 at 12:31
@MSalters ah yes.. so it is :). –  IanNorton Nov 14 '11 at 20:52
@JanHudec "if any piece of it is derived" if my program uses the original GPL library (without changing, modification, touching, just use), then can my program be a non-derived work, and not fall under GPL terms? –  BMH Feb 14 '14 at 11:32
@BMH: A binary is derived work of the GPL code even if it is unmodified an then GPL applies to all sources that were used to create the binary. The sources themselves are not covered and you can distribute them by themselves under another license, but whenever you distribute binaries, you have to provide the sources under GPL if asked. –  Jan Hudec Feb 14 '14 at 12:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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