From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id D71D03858002; Fri, 19 Jan 2024 10:52:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D71D03858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705661530; bh=SezgWuKLI/ydJR4fAJzLtH552E+vvZqsHUkk5W/Ihy8=; h=From:To:Subject:Date:From; b=x5Elt5qEs4rEredYOz5rcNBZ/5Psyuds+k/opkAH28ysh3hSBALXjZHVian4vrV6J W92klx2Ub2WVXCHKVXfElEgx6FNnUgz9Kx8iX6PilOu2hgBWzy+rgDd4VvluXe36Mc mpCQczJPhFi35Wj5M2ZxfDw0+P7AAxLWVEWlgarA= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] ORIENT: avoid "expression has no effect" warning X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: d13d9220bf47f7e91b02c5c8e214780bda840606 X-Git-Newrev: 29ec33360da9171f1df27ef59ea4576fda4065ff Message-Id: <20240119105210.D71D03858002@sourceware.org> Date: Fri, 19 Jan 2024 10:52:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D29ec33360da= 9171f1df27ef59ea4576fda4065ff commit 29ec33360da9171f1df27ef59ea4576fda4065ff Author: Corinna Vinschen AuthorDate: Fri Jan 19 11:20:17 2024 +0100 Commit: Corinna Vinschen CommitDate: Fri Jan 19 11:51:01 2024 +0100 ORIENT: avoid "expression has no effect" warning =20 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. =20 Explicitely void the expression in these cases to avoid the warning. =20 Signed-off-by: Corinna Vinschen 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, =20 _newlib_flockfile_start (fp); if (mode !=3D 0) { - ORIENT (fp, mode); + (void) ORIENT (fp, mode); } if (!(fp->_flags & __SORD)) ret =3D 0; diff --git a/newlib/libc/stdio/open_memstream.c b/newlib/libc/stdio/open_me= mstream.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 |=3D __SL64; #endif fp->_close =3D 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; =20 _newlib_flockfile_start (fp); - ORIENT (fp, 1); + (void) ORIENT (fp, 1); if (wc =3D=3D WEOF) wc =3D WEOF; else if ((len =3D _wcrtomb_r(ptr, buf, wc, &fp->_mbstate)) =3D=3D (size_= t)-1)