public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/main] ORIENT: avoid "expression has no effect" warning
Date: Fri, 19 Jan 2024 10:52:10 +0000 (GMT)	[thread overview]
Message-ID: <20240119105210.D71D03858002@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=29ec33360da9171f1df27ef59ea4576fda4065ff

commit 29ec33360da9171f1df27ef59ea4576fda4065ff
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Fri Jan 19 11:20:17 2024 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Fri Jan 19 11:51:01 2024 +0100

    ORIENT: avoid "expression has no effect" warning
    
    The warning "right-hand operand of comma expression has no effect
    [-Wunused-value]" crops up with -Wall in cases where ORIENT is called
    without checking or assigning its value.
    
    Explicitely void the expression in these cases to avoid the warning.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/stdio/fwide.c          | 2 +-
 newlib/libc/stdio/open_memstream.c | 2 +-
 newlib/libc/stdio/ungetwc.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/newlib/libc/stdio/fwide.c b/newlib/libc/stdio/fwide.c
index 9b5a3d12a793..1d2430468116 100644
--- a/newlib/libc/stdio/fwide.c
+++ b/newlib/libc/stdio/fwide.c
@@ -58,7 +58,7 @@ _fwide_r (struct _reent *ptr,
 
   _newlib_flockfile_start (fp);
   if (mode != 0) {
-    ORIENT (fp, mode);
+    (void) ORIENT (fp, mode);
   }
   if (!(fp->_flags & __SORD))
     ret = 0;
diff --git a/newlib/libc/stdio/open_memstream.c b/newlib/libc/stdio/open_memstream.c
index e3a52ed33dbe..97b13b7bfc10 100644
--- a/newlib/libc/stdio/open_memstream.c
+++ b/newlib/libc/stdio/open_memstream.c
@@ -367,7 +367,7 @@ internal_open_memstream_r (struct _reent *ptr,
   fp->_flags |= __SL64;
 #endif
   fp->_close = memcloser;
-  ORIENT (fp, wide);
+  (void) ORIENT (fp, wide);
   _newlib_flockfile_end (fp);
   return fp;
 }
diff --git a/newlib/libc/stdio/ungetwc.c b/newlib/libc/stdio/ungetwc.c
index 16d37f2d176c..a04ca3467d61 100644
--- a/newlib/libc/stdio/ungetwc.c
+++ b/newlib/libc/stdio/ungetwc.c
@@ -82,7 +82,7 @@ _ungetwc_r (struct _reent *ptr,
   size_t len;
 
   _newlib_flockfile_start (fp);
-  ORIENT (fp, 1);
+  (void) ORIENT (fp, 1);
   if (wc == WEOF)
     wc = WEOF;
   else if ((len = _wcrtomb_r(ptr, buf, wc, &fp->_mbstate)) == (size_t)-1)

                 reply	other threads:[~2024-01-19 10:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240119105210.D71D03858002@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).