texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * info/man.c (check_manpage_node, get_manpage_fro


From: Gavin D. Smith
Subject: branch master updated: * info/man.c (check_manpage_node, get_manpage_from_formatter): Apply ! operator to result of freopen, to silence obnoxious gcc warning.
Date: Sun, 16 Oct 2022 09:38:00 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 069e0c9e71 * info/man.c (check_manpage_node, 
get_manpage_from_formatter): Apply ! operator to result of freopen, to silence 
obnoxious gcc warning.
069e0c9e71 is described below

commit 069e0c9e7181ce8445600de70878bb7a874cad7d
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Oct 16 14:37:51 2022 +0100

    * info/man.c (check_manpage_node, get_manpage_from_formatter):
    Apply ! operator to result of freopen, to silence obnoxious gcc
    warning.
---
 ChangeLog  |  6 ++++++
 info/man.c | 10 ++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fc3a1ebe6c..152a8a641b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-10-16  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * info/man.c (check_manpage_node, get_manpage_from_formatter):
+       Apply ! operator to result of freopen, to silence obnoxious gcc
+       warning.
+
 2022-10-16  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * system.h (ALSO_NULL_DEVICE): Remove unused.
diff --git a/info/man.c b/info/man.c
index 351cd3e972..37df94c3a0 100644
--- a/info/man.c
+++ b/info/man.c
@@ -82,8 +82,9 @@ check_manpage_node (char *pagename)
   if (!child)
     {
       int ret;
-      freopen (NULL_DEVICE, "w", stdout);
-      freopen (NULL_DEVICE, "w", stderr);
+      (void)! freopen (NULL_DEVICE, "w", stdout);
+      (void)! freopen (NULL_DEVICE, "w", stderr);
+      /* avoid "unused result" warning with ! operator */
       char *formatter = find_man_formatter();
       if (!formatter)
         exit (1);
@@ -390,8 +391,9 @@ get_manpage_from_formatter (char *formatter_args[])
     { /* In the child, close the read end of the pipe, make the write end
          of the pipe be stdout, and execute the man page formatter. */
       close (pipes[0]);
-      freopen (NULL_DEVICE, "w", stderr);
-      freopen (NULL_DEVICE, "r", stdin);
+      (void)! freopen (NULL_DEVICE, "w", stderr);
+      (void)! freopen (NULL_DEVICE, "r", stdin);
+      /* avoid "unused result" warning with ! operator */
       dup2 (pipes[1], fileno (stdout));
 
       execv (formatter_args[0], formatter_args);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]