]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Update Copyright for gen-evolution.awk and gen-cxxapi-file.py
authorJakub Jelinek <jakub@redhat.com>
Fri, 9 Jan 2026 20:54:38 +0000 (21:54 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 9 Jan 2026 20:59:16 +0000 (21:59 +0100)
On Fri, Jan 09, 2026 at 05:54:47PM +0000, Joseph Myers wrote:
> I think updates to gcc/config/loongarch/genopts/gen-evolution.awk's calls
> to copyright_header are needed as well.  At present, building for
> loongarch can result in files in the source tree being reverted to older
> copyright dates because the generation hasn't been updated (discovered via
> my glibc bot with GCC mainline stopping updating its GCC source tree
> because such modifications appeared in the sources).  Of course this also
> shows up missing entries in contrib/gcc_update for the three files
> generated by gen-evolution.awk.

gen-evolution.awk was explicitly blacklisted
and so was gen-cxxapi-file.py, both because update-copyright.py
matched Copyright line also within the printing code but it wasn't
matching the expected form.
Fixed by making sure the printing code doesn't match it by using
print "   Copy" "right (C) " ... in the awk case and
Copy{:s}right in the python case (with "" arg added).

2026-01-09  Jakub Jelinek  <jakub@redhat.com>

contrib/
* update-copyright.py (GCCFilter): Don't filter out
gen-evolution.awk and gen-cxxapi-file.py.
gcc/
* config/loongarch/genopts/gen-evolution.awk: Update
copyright year.
(copyright_header): Separate parts of Copyright word
with " " so that it doesn't get matched by update-copyright.py.
(gen_full_header, gen_full_source, gen_full_def): Include
2026 year in the ranges.
gcc/cp/
* gen-cxxapi-file.py: Update copyright year.  Separate
parts of Copyright word with {:s} so that it doesn't get matched
by update-copyright.py.

contrib/update-copyright.py
gcc/config/loongarch/genopts/gen-evolution.awk
gcc/cp/gen-cxxapi-file.py

index 6b31c687f51d238e3c0611590faf6c7adfa40a3e..b19a9404155a0a3ba1b7d4ab2962589b17661d68 100755 (executable)
@@ -560,8 +560,6 @@ class GCCFilter (GenericFilter):
 
                 # Weird ways to compose copyright year
                 'GmcOptions.cc',
-                'gen-evolution.awk',
-                'gen-cxxapi-file.py',
                 ])
 
         self.skip_dirs |= set ([
index 789be8054b2b67a67b7ff04c2d78b6793ed7299c..e3aacf968a46f1e8ede1cc74775101e82d3f201d 100644 (file)
@@ -3,7 +3,7 @@
 # A simple script that generates loongarch-evolution.h
 # from genopts/isa-evolution.in
 #
-# Copyright (C) 2021-2025 Free Software Foundation, Inc.
+# Copyright (C) 2021-2026 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -49,10 +49,12 @@ BEGIN {
 function copyright_header(from_year,to_year)
 {
     if (to_year == "")
-      print "   Copyright (C) " from_year \
+      # The weird " " in the middle of a word is to make
+      # contrib/update_copyright.py happy.
+      print "   Copy" "right (C) " from_year \
            " Free Software Foundation, Inc."
     else
-      print "   Copyright (C) " from_year "-" to_year \
+      print "   Copy" "right (C) " from_year "-" to_year \
            " Free Software Foundation, Inc."
     print ""
     print "This file is part of GCC."
@@ -165,7 +167,7 @@ function gen_full_header()
     print "   Please do not edit this file directly."
     print ""
 
-    copyright_header(2023, 2025)
+    copyright_header(2023, 2026)
 
     print "*/"
     print ""
@@ -201,7 +203,7 @@ function gen_full_source()
     print "   Please do not edit this file directly."
     print ""
 
-    copyright_header(2023, 2025)
+    copyright_header(2023, 2026)
 
     print "*/"
     print ""
@@ -244,7 +246,7 @@ function gen_full_def()
     print "   Please do not edit this file directly."
     print ""
 
-    copyright_header(2025)
+    copyright_header(2025, 2026)
 
     print "*/"
     print ""
index 9e2cc2c713947fe31764861e0d4cce6528ef408e..446a166f014abd85e865b986e08ad082cf549ba3 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# Copyright (C) 2022-2025 Free Software Foundation, Inc.
+# Copyright (C) 2022-2026 Free Software Foundation, Inc.
 # This file is part of GCC.
 
 # GCC is free software; you can redistribute it and/or modify
@@ -95,7 +95,7 @@ def hints(script, content):
 %struct-type
 %{{
 /* This file is auto-generated by {:s}.  */
-/* Copyright (C) 2022-{:s} Free Software Foundation, Inc.
+/* Copy{:s}right (C) 2022-{:s} Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -130,7 +130,7 @@ struct std_name_hint
 # as defined in the C++ language specification.  The result is used in the
 # get_std_name_hint functions.
 #   throws an exception.
-#""".format(script, time.strftime('%Y')))
+#""".format(script, "", time.strftime('%Y')))
     header = ''
     printed_header = False
     for e in content: