Projects
home:lf14:branches:Mega:23.09
glibc
_service:tar_scm:backport-clang-0015-sunrpc-Sup...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-clang-0015-sunrpc-Suppress-clang-warning-on-struct-cmessage.patch of Package glibc
From bf8a8e23506d26b79d03b4e23661e2a5a37d6990 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Thu, 10 Mar 2022 14:08:06 -0300 Subject: [PATCH] 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. --- 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 <libintl.h> #include <wchar.h> #include <shlib-compat.h> +#include <libc-diag.h> /* * 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 -- 2.39.3
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2