Source: snacc
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Various header files embed the timestamp when it was generated in
comments:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/amd64/diffoscope-results/snacc.html

  /usr/include/snacc/c/asn-useful.h

  ·*····This·.h·file·was·generated·by·snacc·on·Fri·May·19·17:42:30·2023
  vs.
  ·*····This·.h·file·was·generated·by·snacc·on·Sun·Apr·17·13:25:08·2022


The attached patch fixes this by removing the timestamps from the code
that generates the header files.


With this patch applied, snacc should become reproducible on
tests.reproducible-builds.org!


live well,
  vagrant
From d44bf7e4857b23f94319aabf0bd3124a9b11ce58 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Fri, 29 Apr 2022 23:05:46 +0000
Subject: [PATCH] reproducible builds: Remove timestamps from generated
 comments.

https://reproducible-builds.org/docs/timestamps/
---
 compiler/back-ends/c++-gen/gen-code.c | 4 ++--
 compiler/back-ends/c-gen/gen-code.c   | 4 ++--
 compiler/back-ends/idl-gen/gen-code.c | 2 +-
 compiler/core/snacc.c                 | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/compiler/back-ends/c++-gen/gen-code.c b/compiler/back-ends/c++-gen/gen-code.c
index d3632dd..8d15682 100644
--- a/compiler/back-ends/c++-gen/gen-code.c
+++ b/compiler/back-ends/c++-gen/gen-code.c
@@ -170,7 +170,7 @@ PrintHdrComment PARAMS ((hdr, m),
     fprintf (hdr, "//\n");
     fprintf (hdr, "// %s - class definitions for ASN.1 module %s\n", m->cxxHdrFileName, m->modId->name);
     fprintf (hdr, "//\n");
-    fprintf (hdr, "//   This file was generated by snacc on %s", ctime (&now));
+    fprintf (hdr, "//   This file was generated by snacc");
     fprintf (hdr, "//   UBC snacc by Mike Sample\n");
     fprintf (hdr, "//   A couple of enhancements made by IBM European Networking Center\n"); /* 20.8.93 Thomas Meyer */
     fprintf (hdr, "\n");
@@ -188,7 +188,7 @@ PrintSrcComment PARAMS ((src, m),
     fprintf (src, "//\n");
     fprintf (src, "// %s - class member functions for ASN.1 module %s\n", m->cxxSrcFileName, m->modId->name);
     fprintf (src, "//\n");
-    fprintf (src, "//   This file was generated by snacc on %s", ctime (&now));
+    fprintf (src, "//   This file was generated by snacc");
     fprintf (src, "//   UBC snacc written by Mike Sample\n");
     fprintf (src, "//   A couple of enhancements made by IBM European Networking Center\n"); /* 20.8.93 Thomas Meyer */
     fprintf (src, "\n");
diff --git a/compiler/back-ends/c-gen/gen-code.c b/compiler/back-ends/c-gen/gen-code.c
index e5c94d9..a198676 100644
--- a/compiler/back-ends/c-gen/gen-code.c
+++ b/compiler/back-ends/c-gen/gen-code.c
@@ -182,7 +182,7 @@ PrintCSrcComment PARAMS ((src, m),
     fprintf (src, "/*\n");
     fprintf (src, " *    %s\n *\n", m->cSrcFileName);
     fprintf (src, " *    \"%s\" ASN.1 module encode/decode/print/free C src.\n *\n", m->modId->name);
-    fprintf (src, " *    This file was generated by snacc on %s *\n", ctime (&t));
+    fprintf (src, " *    This file was generated by snacc *\n");
     fprintf (src, " *    UBC snacc written by Mike Sample\n *\n");
     fprintf (src, " *    NOTE: This is a machine generated file - editing not recommended\n");
     fprintf (src, " */\n\n\n");
@@ -231,7 +231,7 @@ PrintCHdrComment PARAMS ((f, m),
     fprintf (f, "/*\n");
     fprintf (f, " *    %s\n *\n", m->cHdrFileName);
     fprintf (f, " *    \"%s\" ASN.1 module C type definitions and prototypes\n *\n", m->modId->name);
-    fprintf (f, " *    This .h file was generated by snacc on %s *\n", ctime (&t));
+    fprintf (f, " *    This .h file was generated by snacc *\n");
     fprintf (f, " *    UBC snacc written compiler by Mike Sample\n *\n");
     fprintf (f, " *    NOTE: This is a machine generated file--editing not recommended\n");
     fprintf (f, " */\n\n\n");
diff --git a/compiler/back-ends/idl-gen/gen-code.c b/compiler/back-ends/idl-gen/gen-code.c
index 9e4c9c2..978e5a6 100644
--- a/compiler/back-ends/idl-gen/gen-code.c
+++ b/compiler/back-ends/idl-gen/gen-code.c
@@ -70,7 +70,7 @@ PrintComment PARAMS ((idl, m),
     fprintf (idl, "//\n");
     fprintf (idl, "// %s -- IDL for ASN.1 module %s\n", m->idlFileName, m->modId->name);
     fprintf (idl, "//\n");
-    fprintf (idl, "//   This file was generated by snacc on %s", ctime (&t));
+    fprintf (idl, "//   This file was generated by snacc");
     fprintf (idl, "//   UBC snacc written by Mike Sample\n");
     fprintf (idl, "//   IDL generator written by Robert Joop\n");
     fprintf (idl, "\n");
diff --git a/compiler/core/snacc.c b/compiler/core/snacc.c
index 96b2683..9b86b9f 100644
--- a/compiler/core/snacc.c
+++ b/compiler/core/snacc.c
@@ -1125,7 +1125,7 @@ GenCxxCode PARAMS ((allMods, longJmpVal, genTypes, genValues, genEncoders, genDe
 	fprintf (meta.srcfp, "//\n");
 	fprintf (meta.srcfp, "// modules.C - reference to all modules and their types\n");
 	fprintf (meta.srcfp, "//\n");
-	fprintf (meta.srcfp, "// This file was generated by snacc on %s", ctime (&now));
+	fprintf (meta.srcfp, "// This file was generated by snacc");
     }
 #endif
     FOR_EACH_LIST_ELMT (currMod, allMods)
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature

Reply via email to