[PATCH] Update after gnulib changed.

Bruno Haible <[email protected]>
Newsgroups gmane.comp.gnu.m4.bugs
Message-ID <5995471.fBvs5tUl15@omega>
Gnulib made an incompatible change. (Yes, this happens occasionally.)
m4 needs the attached patch in order to avoid compilation errors:

  CC       macro.o
  CC       output.o
output.c: In function 'm4_tmpfile':
output.c:228:10: error: too few arguments to function 'fopen_temp'
   file = fopen_temp (name, O_BINARY ? "wb+" : "w+");
          ^
In file included from m4.h:39:0,
                 from output.c:22:
../lib/clean-temp.h:125:15: note: declared here
 extern FILE * fopen_temp (const char *file_name, const char *mode,
               ^
output.c: In function 'm4_tmpopen':
output.c:270:10: error: too few arguments to function 'fopen_temp'
   file = fopen_temp (name, O_BINARY ? "rb+" : "r+");
          ^
In file included from m4.h:39:0,
                 from output.c:22:
../lib/clean-temp.h:125:15: note: declared here
 extern FILE * fopen_temp (const char *file_name, const char *mode,
               ^
Makefile:1863: recipe for target 'output.o' failed
make[2]: *** [output.o] Error 1
0001-Update-after-gnulib-changed.patch (text/x-patch, 1.4 KB)
From 04b761f0e3c282852dd07619ba5d1fad03fb89e6 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 4 Jul 2020 10:29:44 +0200
Subject: [PATCH] Update after gnulib changed.

* src/output.c (m4_tmpfile, m4_tmpopen): Update fopen_temp invocations.
---
 src/output.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/output.c b/src/output.c
index a4ad527..f5dee7c 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1,6 +1,6 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2004-2014, 2016-2017 Free Software
+   Copyright (C) 1989-1994, 2004-2014, 2016-2017, 2020 Free Software
    Foundation, Inc.
 
    This file is part of GNU M4.
@@ -225,7 +225,7 @@ m4_tmpfile (int divnum)
     }
   name = m4_tmpname (divnum);
   register_temp_file (output_temp_dir, name);
-  file = fopen_temp (name, O_BINARY ? "wb+" : "w+");
+  file = fopen_temp (name, O_BINARY ? "wb+" : "w+", false);
   if (file == NULL)
     {
       unregister_temp_file (output_temp_dir, name);
@@ -267,7 +267,7 @@ m4_tmpopen (int divnum, bool reread)
     }
   name = m4_tmpname (divnum);
   /* We need update mode, to avoid truncation.  */
-  file = fopen_temp (name, O_BINARY ? "rb+" : "r+");
+  file = fopen_temp (name, O_BINARY ? "rb+" : "r+", false);
   if (file == NULL)
     M4ERROR ((EXIT_FAILURE, errno,
               "cannot create temporary file for diversion"));
-- 
2.7.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.