From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 491D13858D3C; Wed, 17 Apr 2024 20:05:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 491D13858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713384339; bh=BvUOH8xYb1KB/bugxmW55lOC55BT2fvv9FUpfSGFxuY=; h=From:To:Subject:Date:From; b=ogR2LdKMAahqbsiJ0n5YjB0Z/NSXSZF4crfcCtFrMblR4ABGL6w1nRpDexm73jYrB UePcXBLzioMwh1a+QQnVfpUNFKLiQMKkNm18Udzg36xFCfYxqbw3gPxFmJGhaXydn9 FY5IqweyRbGdGm4uckhrUTRk3ixSHK7FD12xcaMU= 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: 5d3b33803f19e208b4c8744120fb84082ec2c625 X-Git-Newrev: 583f8d7fd4c5ddf1758cc58967ce72737431b64a Message-Id: <20240417200539.491D13858D3C@sourceware.org> Date: Wed, 17 Apr 2024 20:05:39 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=583f8d7fd4c5ddf1758cc58967ce72737431b64a commit 583f8d7fd4c5ddf1758cc58967ce72737431b64a Author: Adhemerval Zanella Date: Thu Mar 10 14:08:06 2022 -0300 sunrpc: Suppress clang warning on struct cmessage 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 suppress the warning. Diff: --- sunrpc/svc_unix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c index 8363669c09..c56284e333 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