19

Sometimes, people ask questions about why a certain program won't work with an open-source compiler, and the answer turns out to be that it is probably a bug in the compiler. One such example is here.

If it looks as if the bug isn't yet known, I recommend to file a bug report. If the user doesn't want to do so for himself, I think everybody is best served if somebody else files that report.

So, would it be OK to take code from a Stack Overflow post and put it on, for example, GCC Bugzilla, maintaing a link to the original code in the bug report to maintain attribution? What if the code (possibly modified) ended up in the GCC testsuite?

5
  • 2
    I don't really get why you mention open-source here. I've found tons of questions about bugs with commercial and closed source software, and these tools often do have a bugtracker anyway, so it's really irrelevant how the tool is distributed as far as it has a public issue tracker. And even if they didn't have one you could still contact the devs by email and provide them the files via attachments.
    – Bakuriu
    Commented Mar 22, 2015 at 8:55
  • 1
    Aside: there is a balance between filing the bug report because the user is lazy, and requesting that the poster do it him/herself. I think I would encourage them to do it, and if no response is received, downvote the question for reasons of lack of effort, and leave a comment explaining that action. For open source in particular, there should be an expectation that a user who discovers a bug should report it - it's more than a fair price!
    – halfer
    Commented Mar 22, 2015 at 11:20
  • 1
    @halfer: The GCC bug tracker has its entry hurdles, especially because you need an account ("oh no, not another one" is a frequent reaction to this...) and because bugzilla can be a bit confusing if you have never used it before. Of course I like it when people do report bugs directly in the database, but I don't want to try to force them. And yes, the road from "bug reporter via some channel" to "bug reporter in bugzilla" to "somebody who writes a trivial patch" to "developer" has been travelled more than once, and I don't want to antagonize anybody who may be a fellow developer one day.
    – user4490638
    Commented Mar 22, 2015 at 23:21
  • I think if you're (fairly) sure the OP is not a help vampire, then that's probably a good approach.
    – halfer
    Commented Mar 22, 2015 at 23:24
  • Good question, I think a did include from here in the bugzilla before, but I always attributed the source. Whether that attribution is now in the testsuite I don't know. Commented Mar 23, 2015 at 10:04

1 Answer 1

32

When filing a bug, including a sample to reproduce it is great. If that sample comes from a Stack Overflow then you need to follow the license used by Stack Overflow.

Simply link back to the post, and state who wrote the code, that's all it takes.

It is rare for such code to actually end up in a test suite; usually OSS developers come up with a much more concise way to reproduce the issue, once clear. If the code example were big enough for there to be a copyright claim (beyond fair use), then again attribution would be required. But if it is just an excerpt I'd not expect to have to include attribution.

Also see What is up with the source code license on Stack Overflow?, where Jeff Atwood, Stack Exchange founder, states:

That said, a snippet of code falls under excerpt category and thus should be free to use under fair use. Heck, we don't even support giant masses of code being posted, so to me, by definition, everything would be an excerpt. We're not sourceforge, github, or codeplex.

10
  • But beware, following the license used by Stack Overflow means not offering it under any other license (unless you are the original poster i.e. copyright holder, then you can offer whatever licenses you want)
    – Ben Voigt
    Commented Mar 20, 2015 at 23:17
  • 14
    It's worth emphasising (or is it) that if the SO question was as good as it should have been, it was already in a perfect condition to form a test case for the project in question. At least in terms of conciseness. But this may be a pipe dream... Commented Mar 21, 2015 at 3:13
  • @BenVoigt you wrote "...unless you are the original poster i.e. copyright holder, then you can offer whatever licenses you want". Do you mean you can indicate which license has to be used with code snippets you post? Commented Mar 23, 2015 at 10:16
  • @AdrianoRepetti You can post it under one license to SO and under different license to somewhere else. It is still your code. Commented Mar 23, 2015 at 10:18
  • @VladimirF yes but from that comment I read that I may post code snippet (of mine) with, for example, GPL license on SO. I thought only SO license can be applicable (somehow merged with original license if code is copyrighted). Think about someone posting code with GPL license...they probably don't want it's even used in LGPL packages (of course assuming source is always attributed). Well you may post code under multiple licenses but hmmmm even to understand implications of ONE license is hard, if you give users free choice to include your code from license they prefer... Commented Mar 23, 2015 at 10:24
  • @AdrianoRepetti: the author of the code has the right to make the code available under more than one license. In that case you have the choice of what license you accept the code under. Licenses are not merged. Commented Mar 23, 2015 at 10:26
  • @AdrianoRepetti: See en.wikipedia.org/wiki/Multi-licensing Commented Mar 23, 2015 at 10:27
  • @MartijnPieters sorry but then I can't understand. If I post something with GPL license then someone else may decide to apply SO license instead? (because all posts are also governed by SO license) Commented Mar 23, 2015 at 10:28
  • 2
    @AdrianoRepetti: yes, code posted here is at the very least licensed under the CC Wiki license. If that code is also available under the GPL, then you have two licenses to choose from. Don't post code you don't have the right to license under CC Wiki here. Mostly you'll be posting short snippets of code however, not complete works. Commented Mar 23, 2015 at 10:34
  • @MartijnPieters I absolutely didn't understand that implication (multiple license). You're right it shouldn't be an issue with code snippets but it's better to know it, thank you very much! Commented Mar 23, 2015 at 10:41

You must log in to answer this question.