From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 2DA2F385840C for ; Mon, 29 May 2023 23:17:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DA2F385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f60e730bf2so38937075e9.1 for ; Mon, 29 May 2023 16:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685402254; x=1687994254; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=TNi+7Lbx8GmHKrFDeVmZCBUmKA2yrs1Hgz7Uhl3w3Tc=; b=QVJBn7JsnjNTCWAzZ77KvR16zhcHpVzr1i0OFIrAfJUBZF+v8Qs/aZH3wty8kBF3PG ieQygD8GFwbrY5ZBWkaPbA8G1fmK//qxuO9pB+833BnRZlR7O1K6VDMMtBVyWSqRHJZg 0awupla7WgEM/QzbO2GJcQ852pJ0/6d67Txr79rJpeJo72+4ydKx/UCBcrijmpWqfe9g JVssITgZ2VDOZ4EYUS444Si/r6Kf892wp0AMBuDzoSbOEipjGaPrz4sfitsQnouJFJ5r vjVpy5jE2BM1xehBFecxr4ZfCb2bT08o12t2RIFy9rQglHJkBAagH7AYekDlcw8qpOwp 13Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685402254; x=1687994254; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=TNi+7Lbx8GmHKrFDeVmZCBUmKA2yrs1Hgz7Uhl3w3Tc=; b=OU/K3NVDybEiqBtT7Ldg/NpFoeG8it+RXciaJaqUT0c+JR3bT8MUQpEZXlO64OGAaM Q19N2MAZLl2ADnqm5Omjcx11kZ/FGg1X0Cgl6S1MyRDztMfk9zAitDqsDbNOKNjyGyvQ clB9efpDKIY95Auj8llrhzWOhNYRxqLdAyWRV3uJEMFmSwnXvLOK5dqgPUVpWl+cx3Ik MYQXJkY1VWZrY0Wuew38TVWU6MTmOtSOPNuqcQ402sFGqxr9RwwQiEB4kYS1w9etHp3G zxKbCOZ4cyfs1717bncRg2fKvvF3/tFbQhKWRQLQrJwrZlHNT/cu1IjDGgfPLMN1FLk9 4tUQ== X-Gm-Message-State: AC+VfDzjDsHGtndPeJiR7S0fEiun6JjQDYBTa+jEmq4FhU+cr65UjQre nIvJ8R3wuwItEGbu1Z1l10j0dCbUoFM= X-Google-Smtp-Source: ACHHUZ60hloVaxJw4hyuhSQLcFzqyM7Q6Ie7kJOe4bQnculKzbMmF+hteZ0iqydJi8IiD1chpXf7lg== X-Received: by 2002:a5d:6382:0:b0:306:2f91:302e with SMTP id p2-20020a5d6382000000b003062f91302emr160983wru.21.1685402253596; Mon, 29 May 2023 16:17:33 -0700 (PDT) Received: from [192.168.0.160] ([170.253.51.134]) by smtp.gmail.com with ESMTPSA id x14-20020adff0ce000000b0030aedb8156esm1248881wro.102.2023.05.29.16.17.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 May 2023 16:17:33 -0700 (PDT) Message-ID: Date: Tue, 30 May 2023 01:17:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] Use __nonnull for the epoll_wait(2) family of syscalls To: Adhemerval Zanella Netto , libc-alpha@sourceware.org Cc: Alejandro Colomar References: <6c399f6b-6e89-17c4-2a56-1219a1b86448@linaro.org> <20230522220120.37208-1-alx@kernel.org> <30f8c03c-ecb3-733a-b14c-cf5509356697@linaro.org> Content-Language: en-US From: Alejandro Colomar In-Reply-To: <30f8c03c-ecb3-733a-b14c-cf5509356697@linaro.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------0ipBG74mxpAx9U3trhPSGiSP" X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------0ipBG74mxpAx9U3trhPSGiSP Content-Type: multipart/mixed; boundary="------------UXaVZEXAwvYz4Xh2vc5LBiWf"; protected-headers="v1" From: Alejandro Colomar To: Adhemerval Zanella Netto , libc-alpha@sourceware.org Cc: Alejandro Colomar Message-ID: Subject: Re: [PATCH] Use __nonnull for the epoll_wait(2) family of syscalls References: <6c399f6b-6e89-17c4-2a56-1219a1b86448@linaro.org> <20230522220120.37208-1-alx@kernel.org> <30f8c03c-ecb3-733a-b14c-cf5509356697@linaro.org> In-Reply-To: <30f8c03c-ecb3-733a-b14c-cf5509356697@linaro.org> --------------UXaVZEXAwvYz4Xh2vc5LBiWf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Adhemerval! On 5/29/23 19:39, Adhemerval Zanella Netto wrote: > In fact, checking I am seeing a regression: >=20 > ../sysdeps/unix/sysv/linux/tst-epoll.c: In function =E2=80=98do_test=E2= =80=99: > ../sysdeps/unix/sysv/linux/tst-epoll.c:194:11: error: argument 2 null w= here non-null expected [-Werror=3Dnonnull] > 194 | int r =3D epoll_pwait2 (-1, NULL, 0, NULL, NULL); > | ^~~~~~~~~~~~ > In file included from ../include/sys/epoll.h:2, > from ../sysdeps/unix/sysv/linux/tst-epoll.c:27: > ../sysdeps/unix/sysv/linux/sys/epoll.h:144:12: note: in a call to funct= ion =E2=80=98epoll_pwait2=E2=80=99 declared =E2=80=98nonnull=E2=80=99 > 144 | extern int epoll_pwait2 (int __epfd, struct epoll_event *__even= ts, > | ^~~~~~~~~~~~ > cc1: all warnings being treated as errors >=20 > And I am not sure why it was not caught by buildbots. I didn't catch it either. I didn't run tests, since I thought if anythin= g failed, it would probably be at compilation stage, so I only compiled. Not sure abo= ut the buildbots, though; those should have caught it. >=20 > The check is only for test for epoll_pwait2 support, so I think it woul= d be simpler to > just suppress the warning: >=20 > diff --git a/sysdeps/unix/sysv/linux/tst-epoll.c b/sysdeps/unix/sysv/li= nux/tst-epoll.c > index 66f091c202..e2fd34e0e6 100644 > --- a/sysdeps/unix/sysv/linux/tst-epoll.c > +++ b/sysdeps/unix/sysv/linux/tst-epoll.c > @@ -18,12 +18,13 @@ >=20 > #include > #include > +#include > +#include > #include > #include > #include > -#include > #include > -#include > +#include > #include >=20 > /* The test focus on checking if the timeout argument is correctly han= dled > @@ -191,7 +192,12 @@ do_test (void) > xsigaction (SIGCHLD, &sa, NULL); > } >=20 > + /* The NULL tests here is only to check if epoll_pwait2 is supported= by the > + kernel and to simplify the rest of test. */ > + DIAG_PUSH_NEEDS_COMMENT; > + DIAG_IGNORE_NEEDS_COMMENT (7, "-Wnonnull"); > int r =3D epoll_pwait2 (-1, NULL, 0, NULL, NULL); > + DIAG_POP_NEEDS_COMMENT; > TEST_COMPARE (r, -1); > bool pwait2_supported =3D errno !=3D ENOSYS; >=20 > Could you send a v3 with the change? Another possibility is to remove = the > pwait2_supported and handle it on the test itself (it would require mor= e > extensive changes). I suggest a slightly different approach: passing the address of a dummy v= ariable. It is even simpler. See the suggested diff below. If you like it, I'll = send a revision with it (which IIRC, should be v2). Cheers, Alex $ git diff diff --git a/sysdeps/unix/sysv/linux/tst-epoll.c b/sysdeps/unix/sysv/linu= x/tst-epoll.c index 66f091c202..abda45c427 100644 --- a/sysdeps/unix/sysv/linux/tst-epoll.c +++ b/sysdeps/unix/sysv/linux/tst-epoll.c @@ -180,6 +180,8 @@ epoll_pwait2_check (int epfd, struct epoll_event *ev,= int maxev, int tmo, static int do_test (void) { + struct epoll_event ev; + { struct sigaction sa; sa.sa_handler =3D handler; @@ -191,7 +193,7 @@ do_test (void) xsigaction (SIGCHLD, &sa, NULL); } =20 - int r =3D epoll_pwait2 (-1, NULL, 0, NULL, NULL); + int r =3D epoll_pwait2 (-1, &ev, 0, NULL, NULL); TEST_COMPARE (r, -1); bool pwait2_supported =3D errno !=3D ENOSYS; =20 --=20 GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5 --------------UXaVZEXAwvYz4Xh2vc5LBiWf-- --------------0ipBG74mxpAx9U3trhPSGiSP Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmR1MoUACgkQnowa+77/ 2zI4dg//TwslWKJIZiL+B0rqzdwapPQJT84y6EudxpJJ8H8CcDIUgbbBv0gMxXTr nEpB9VESj0wGFNn2i57jM7PIOqUsajlmxWn/mOGzrpCKvUqN/D7WScMeBbTnJe6s l1vcRKgSNhM9UFXDqwvbswAtQ7ndn4fmrHC1zFJicxmzhlK1ZKPVotX+6SFnhY3g WFVXQPwUEXCV4pLIFDSsCoZEGvfhIvNS4tnGBhSuUQwqnmBPHYCBGNKw0h8125y8 HZo/RaKi42xdAnPzhQ0vDpc7I35lEGC3QB+ls3LrhOEgHrUyJt5q8DBqZS9Gjm8l H7DFaKOUoFiY5n8f/01nkH4SL4QzRZbNaUHJJ8wIvAmX5nmqetzMEq9qZXGZz4qn PPxMbosjXHYTb1Q+K3o2zEd7DZrlCXmi1vcwoGePixONrxpMAvx1pNx7boh75+HY UNRZhoDpTufHlZD0Zko09pvExBXQM+Hcr3KX1pbTzZEbqHHkSSgS5R/lH0qwLC0t deEP472X2hE8D2D4TvuSl8xaiqyxd+vkXEzfs+iuJ9eF4r2Z3549/kx1DOZd80Gj U2vXROiMrXDelnbIXDYOT2yF1d3XR5GH5HFRZD1+PtsVnVA1rd3sicSNs9ZKMESF ZSDYgfAdbLLy+SdS+J99AL/6BePY6+c2ipfSmMUSY2cX5xvPk2M= =r0M6 -----END PGP SIGNATURE----- --------------0ipBG74mxpAx9U3trhPSGiSP--