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]

[PATCH] gengtype copyright notice date


Dear All,

I'm curious about why gengtype generated C files contain a copyright
notice. I am not a lawyer (and do not know at all the US law, being
European) and I naively thought that generated files do not need a
copyright (my intuition being that a copyright is given by a human
being, or a legal entity, not a program, to the FSF). So I believe
that if there is a copyright there, it is for some good reason I don't
fully grasp.

However, if the copyright notice in gt-*.h (and other gengtype
generated files in $GCCBUILD/gcc/) is truely required, I would tend to
believe that it should have the current year (at generation time) in
it, not some fixed 2004 year (I do not understand the logic in
copyrighting 2004 a gt-foo.h file generated from foo.c coded in 2006
or 2007).

The (small but perhaps not trivial) patch (to gcc trunk rev 119655)
after my signature corrects this (and yes, my copyright assignment
paperwork is done). To avoid querying the date and local time at
gengtype time, I hardwire the __DATE__ inside.


This brings a question of more importance to me. As I suggested in the
http://gcc.gnu.org/ml/gcc/2006-12/msg00158.html thread, I need to hack
the GGC garbage collector to permit, for some few GTY(())-ed
struct-ures, to have an explicit "destructor" function which is run
when the ggc_collect-or actually delete such a value. The typical use
is to have some passes which need to box MPFR or PPL data inside some
GTY(())-ed stuff (and I see no clean way to avoid having to run some
"destructor" from the garbage collector, even if some dirty hacks
could avoid this).

If I submit a patch which add this GTY((destructor)) stuff, do I need
to refer to it or include it in further patches which require this
stuff?

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

Changelog:
2006-12-08  Basile Starynkevitch  <basile@starynkevitch.net>
	* gcc/gengtype.c (create_file): the generated copyright notice
	  has a more sensible year.

Index: gcc/gengtype.c
===================================================================
--- gcc/gengtype.c	(revision 119655)
+++ gcc/gengtype.c	(working copy)
@@ -1,5 +1,5 @@
 /* Process source files and output type information.
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1021,7 +1021,6 @@
 create_file (const char *name, const char *oname)
 {
   static const char *const hdr[] = {
-    "   Copyright (C) 2004 Free Software Foundation, Inc.\n",
     "\n",
     "This file is part of GCC.\n",
     "\n",
@@ -1045,12 +1044,22 @@
   outf_p f;
   size_t i;
 
+  const char* year = __DATE__ + 7 /* the date is like "Dec 22 2005" */;
+  int yearnum;
   f = XCNEW (struct outf);
   f->next = output_files;
   f->name = oname;
   output_files = f;
+  /* we output a sensible year for the copyright notice in the
+     generated file */
+  yearnum = atoi(year);
+  if (yearnum < 2001 || yearnum > 3000) 
+    year = "2006"; 
 
   oprintf (f, "/* Type information for %s.\n", name);
+  oprintf (f, "   Copyright (C) %.4s Free Software Foundation, Inc.\n",
+	   year);
+
   for (i = 0; i < ARRAY_SIZE (hdr); i++)
     oprintf (f, "%s", hdr[i]);
   return f;


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