This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gengtype: emit a more appropriate copyright year in generated files.


On Wed, 5 Jan 2011 15:54:07 +0000 (UTC)
"Joseph S. Myers" <joseph@codesourcery.com> wrote:
> 
> Regarding generated files, GNU policy says "When a file is automatically 
> generated from some other file in the distribution, it is useful for the 
> automatic procedure to copy the copyright notice and permission notice of 
> the file it is generated from, if possible. Alternatively, put a notice at 
> the beginning saying which file it is generated from.".  But I don't think 
> this applies to files only used in the build process, such as those 
> generated by gengtype; only to those that are actually included in the 
> source distribution or installed.

But now (and actually even in 4.5, although it was a nightmare)
gengtype also generates files for plugins. So if some entity or person
writes a GCC plugin with plugin.h plugin1.c plugin2.c source files (and
assuming that plugin has its own GTY-ed types), it makes sense to
generate a gt-plugin.h using gengtype.

Regarding copyright notices in generated source files, I see two
different cases: first, the common case when a generated file
corresponds to a single source file (the source file is the file
manually edited & written by a human programmer). This is the case of
bison, flex (and GCC MELT). In that case, the easiest thing to do is to
copy the copyright notice from the source to the generated code file.
In MELT, the (comment ...) syntax is exactly for that purpose!

But gengtype may generate a single gt*.h file from several source
files. And actually, the gengtype generated file gtype-desc.c contains
code generated from many GCC source files. Ok, that particular file is
relevant only at build time. However, in the plugin case, the generated
gt-plugin.h borrow information from all of plugin.h plugin1.c
plugin2.c

However, I still believe that the hard-wired copyright date (C) 2004,
2007, 2009 in the gengtype generated code is currently wrong, and that
putting the date of generation seems more logicial. 

As a concrete case, I don't understand why the gengtype generated files
of the MELT branch bears a copyright notice of (C) 2004, 2007, 2009.
These years are certainly wrong: in 2004, MELT did not exist, not even
in my head.

Maybe gengtype should be enhanced to understand more that just GTY
annotations. Eg a GTYCOPYRIGHTDATE(2007) or GTYCOPYRIGHTDATEINTERVAL
(2007,2010). But that won't happen quickly (and I am not sure it is
worth the effort).

Cheers.


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]