> On 18 Apr 2018, at 15:56, Kaz Kylheku <k...@kylheku.com> wrote: > > What I'm saying is that Flex 2.5.35 in an Ubuntu installation I'm > using has this behavior: > > /* comment */ > %{ > #include "header.h" > %} > /* ... */ > > The header comment is propagated to the lex.yy.c file. It's not at the top > of the file; it follows some preamble material. Then a #line 1 directive > appears, followed by that comment.
Yes, I see that. Perhaps it is bug in Bison: there is no #line 1. >>> That little GNU license blurb is still a problem there. A pre-built y.tab.c >>> file could end up being packaged as a distributed file: say, for the >>> convenience of users who don't have a Yacc installed. >> The license applies to stuff in the skeleton M4 file that is copied >> over, so it should be there. > > Unfortunately, it doesn't clarify what it applies to; it appears to > apply to the entire file. > > It should delineate exactly which lines it applies to. Otherwise it > is not appropriate. For instance, "The following copyright notice > applies only to that portion of this which occurs between the symbols > START_BISON_SKELETON and END_BISON_SKELETON". > > If it is necessary to preserve that notice in a derived work such > as y.tab.c, it follows that it must be preserved in the derived work > y.tab.o also. Most copyright notices don't specify exactly what is copyrighted. >>> What I've done is added a sed filter to my build rule which basically >>> takes that notice out of the y.tab.c right after the file is >>> generated. >> That wouldn't be legal: your copyright does not override the one for >> the skeleton file contents. > > It's perfectly legal; I'm allowed to do anything with that code, > including compiling it into a proprietary executable program whose > image contains no copyright strings. > > I'm not taking away the copyright itself; just the mistaken notice. > > Most importantly, I'm also not redistributing any portion of Bison. > I'm redistributing a program, which has a Makefile, which removes > some cruft from y.tab.c after making it with the user's installation > of Bison. > > If someone mistakenly picks up that y.tab.c into some tarball > and redistributes it (not my action, theirs) my work is protected > from being tainted by a misapplied license. > The onus is on that redistributor to ensure that everything has > the appropriate notice. I don't intend y.tab.c to be redistributed; > for all I care, it can be regenerated each time parser.y is > newer than parser.o, and deleted immediately after parser.o is > produced; it's just worse that way for debugging purposes. It is common to distribute the parser .c file as it is written to be platform independent, and there may be a problem with the Yacc/Bison installation. In such case, it would appropriate to have the notice for the M4 contents as well.