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 at 17:17

4 Answers 4

up vote 13 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
I'll accept the answer, however, (after some research) it turned out while copying subroutine most likely, will "trigger" GPL, "derived work" has some kind of a specific legal meaning in US law, and resulting program won't be "derived work" as defined by copyright laws. That explains why "GPLv3" does not use "derived work" anywhere in license text. Also, there are restrictions on copyright laws, and certain portions of code are not copyrighteable, but to determine what is and what isn't copyrihgteable, you need court decision. –  SigTerm Nov 15 '11 at 2:21

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

You mean, if my code contains

i = 0;

then I have copied from perhaps a dozen GPL-ed programs, but if it reads

thisVariableMostLikelyNotFoundInGPLCode = 0;

then I have not? Very funny, indeed.

share|improve this answer
This is not an answer to this question. Use "comments" for things like this. –  SigTerm Nov 14 '11 at 18:32
It is an answer. It shows the absurdity of the OP's premise/question (if one copies but 1 line, then it is be "derived work"). Others have told the same in more legalese style. I prefer the "If consequences are absurd, go back and check your premisses." style. –  Ingo Nov 15 '11 at 0:38

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 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 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.