From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id D2A1B385781A; Thu, 9 Feb 2023 19:47:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2A1B385781A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675972022; bh=AV9yBnf8JA33yH8PGfg/eZJxqc8VJRsl8+Eg+r0NqOE=; h=From:To:Subject:Date:From; b=cGMGOovdRA2lzn/Yp5yXVhyd+I2J82ew3hd1aEQTDL1tYXNFqQgC+ybl0S9uyCasT damLIGjOD8ldzCueLHXSNf5t6dCNtZprWudS5f0TKIPEozflG4YiDgMdkBwXvBEwXN 01WPNP172qfAf/t8XzSQadpmLhGNbkU4FHyQ9Md4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] sunrpc: Suppress clang warning on struct cmessage X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: d9153632a37ef0485caa8320b5bec2c5d48e9f7a X-Git-Newrev: 162729ed31e33724f9285180d6ca12e40189b9ae Message-Id: <20230209194702.D2A1B385781A@sourceware.org> Date: Thu, 9 Feb 2023 19:47:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=162729ed31e33724f9285180d6ca12e40189b9ae commit 162729ed31e33724f9285180d6ca12e40189b9ae Author: Adhemerval Zanella Date: Thu Mar 10 14:08:06 2022 -0300 sunrpc: Suppress clang warning on struct cmessage Diff: --- sunrpc/svc_unix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c index be247f748c..9426850e4b 100644 --- a/sunrpc/svc_unix.c +++ b/sunrpc/svc_unix.c @@ -65,6 +65,7 @@ #include #include #include +#include /* * Ops vector for AF_UNIX based rpc service handle @@ -308,12 +309,18 @@ svcunix_destroy (SVCXPRT *xprt) } #ifdef SCM_CREDENTIALS +/* clang complains if a flexible array member (struct cmsghdr) is not a the + end of the struct (since it is a GNU extension). The __msgread explicit + expects that 'struct ucred' is after the 'cmsg', so disable the warning. */ +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wgnu-variable-sized-type-not-at-end"); struct cmessage { struct cmsghdr cmsg; struct ucred cmcred; /* hack to make sure we have enough memory */ char dummy[(CMSG_ALIGN (sizeof (struct ucred)) - sizeof (struct ucred) + sizeof (long))]; }; +DIAG_POP_NEEDS_COMMENT_CLANG; /* XXX This is not thread safe, but since the main functions in svc.c and the rpcgen generated *_svc functions for the daemon are also not