From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 84521433A2 for ; Mon, 8 Aug 2022 20:40:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3A0E68B778; Mon, 8 Aug 2022 23:40:06 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1256D68B413 for ; Mon, 8 Aug 2022 23:40:00 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 278Kdw8f028621-278Kdw8g028621 for ; Mon, 8 Aug 2022 23:39:58 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id CCE5BA1468 for ; Mon, 8 Aug 2022 23:39:58 +0300 (EEST) Date: Mon, 8 Aug 2022 23:39:57 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: <6b6fdd7c-91a6-c03a-6e6f-bc984e6fb326@martin.st> References: <20220525074338.7879-1-martin@martin.st> <020A0AEE-E282-4949-9F2E-64BE9924DA41@amazon.com> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] checkasm: Silence warnings about unused return value from read() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-15"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 5 Aug 2022, Martin Storsj=F6 wrote: > On Wed, 27 Jul 2022, Andreas Rheinhardt wrote: > >> Swinney, Jonathan: >>> This patch looks good to me. I would appreciate its merging. >>> = > >> } while (0) >> #define PERF_STOP(t) do { \ >> + int ret; \ >> ioctl(sysfd, PERF_EVENT_IOC_DISABLE, 0); \ >> - read(sysfd, &t, sizeof(t)); \ >> + ret =3D read(sysfd, &t, sizeof(t)); \ >> + (void)ret; \ >> } while (0) > >> Why do you use this extra variable instead of just casting the return >> value of read to void? > > Because if I just cast the return value of read to void, it still warns a= bout = > it being unused, at least with GCC 9. I believe the rules for "used vs = > unused" for variables (where you can cast it to void to mark it as used) = and = > "must not ignore return value" (-Wunused-result) differ. Apparently, in o= rder = > to appease the compiler for a return value to not be ignored, it either h= as = > to be stored or compared. Pushed this now. // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".