From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: [linux-next:master 2092/6266] scm_rights.c:203:18: warning: field 'cmsghdr' with variable sized type 'struct cmsghdr' not at the end of a struct or class is a GNU extension
Date: Tue, 16 Apr 2024 03:22:31 +0800 [thread overview]
Message-ID: <202404160354.YBvIGPEM-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "low confidence bisect report"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Kuniyuki Iwashima <kuniyu@amazon.com>
CC: Jakub Kicinski <kuba@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6bd343537461b57f3efe5dfc5fc193a232dfef1e
commit: 2aa0cff26ed53bc8d4855292b501759435ffdd38 [2092/6266] selftest: af_unix: Test GC for SCM_RIGHTS.
:::::: branch date: 13 hours ago
:::::: commit date: 2 weeks ago
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240416/202404160354.YBvIGPEM-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202404160354.YBvIGPEM-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from scm_rights.c:13:
./../../kselftest_harness.h:1205:30: warning: format string is empty [-Wformat-zero-length]
1205 | diagnostic ? "%s" : "", diagnostic);
| ^~
>> scm_rights.c:203:18: warning: field 'cmsghdr' with variable sized type 'struct cmsghdr' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
203 | struct cmsghdr cmsghdr;
| ^
2 warnings generated.
vim +203 tools/testing/selftests/net/af_unix/scm_rights.c
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 194
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 195 void __send_fd(struct __test_metadata *_metadata,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 196 const FIXTURE_DATA(scm_rights) *self,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 197 const FIXTURE_VARIANT(scm_rights) *variant,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 198 int inflight, int receiver)
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 199 {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 200 #define MSG "nop"
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 201 #define MSGLEN 3
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 202 struct {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 @203 struct cmsghdr cmsghdr;
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 204 int fd[2];
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 205 } cmsg = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 206 .cmsghdr = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 207 .cmsg_len = CMSG_LEN(sizeof(cmsg.fd)),
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 208 .cmsg_level = SOL_SOCKET,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 209 .cmsg_type = SCM_RIGHTS,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 210 },
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 211 .fd = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 212 self->fd[inflight * 2],
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 213 self->fd[inflight * 2],
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 214 },
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 215 };
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 216 struct iovec iov = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 217 .iov_base = MSG,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 218 .iov_len = MSGLEN,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 219 };
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 220 struct msghdr msg = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 221 .msg_name = NULL,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 222 .msg_namelen = 0,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 223 .msg_iov = &iov,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 224 .msg_iovlen = 1,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 225 .msg_control = &cmsg,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 226 .msg_controllen = CMSG_SPACE(sizeof(cmsg.fd)),
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 227 };
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 228 int ret;
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 229
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 230 ret = sendmsg(self->fd[receiver * 2 + 1], &msg, variant->flags);
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 231 ASSERT_EQ(MSGLEN, ret);
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 232 }
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 233
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <yujie.liu@intel.com>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: <oe-kbuild-all@lists.linux.dev>,
Linux Memory Management List <linux-mm@kvack.org>,
Jakub Kicinski <kuba@kernel.org>
Subject: [linux-next:master 2092/6266] scm_rights.c:203:18: warning: field 'cmsghdr' with variable sized type 'struct cmsghdr' not at the end of a struct or class is a GNU extension
Date: Tue, 16 Apr 2024 13:59:24 +0800 [thread overview]
Message-ID: <202404160354.YBvIGPEM-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6bd343537461b57f3efe5dfc5fc193a232dfef1e
commit: 2aa0cff26ed53bc8d4855292b501759435ffdd38 [2092/6266] selftest: af_unix: Test GC for SCM_RIGHTS.
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <yujie.liu@intel.com>
| Closes: https://lore.kernel.org/r/202404160354.YBvIGPEM-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from scm_rights.c:13:
./../../kselftest_harness.h:1205:30: warning: format string is empty [-Wformat-zero-length]
1205 | diagnostic ? "%s" : "", diagnostic);
| ^~
>> scm_rights.c:203:18: warning: field 'cmsghdr' with variable sized type 'struct cmsghdr' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
203 | struct cmsghdr cmsghdr;
| ^
2 warnings generated.
vim +203 tools/testing/selftests/net/af_unix/scm_rights.c
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 194
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 195 void __send_fd(struct __test_metadata *_metadata,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 196 const FIXTURE_DATA(scm_rights) *self,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 197 const FIXTURE_VARIANT(scm_rights) *variant,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 198 int inflight, int receiver)
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 199 {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 200 #define MSG "nop"
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 201 #define MSGLEN 3
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 202 struct {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 @203 struct cmsghdr cmsghdr;
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 204 int fd[2];
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 205 } cmsg = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 206 .cmsghdr = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 207 .cmsg_len = CMSG_LEN(sizeof(cmsg.fd)),
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 208 .cmsg_level = SOL_SOCKET,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 209 .cmsg_type = SCM_RIGHTS,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 210 },
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 211 .fd = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 212 self->fd[inflight * 2],
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 213 self->fd[inflight * 2],
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 214 },
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 215 };
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 216 struct iovec iov = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 217 .iov_base = MSG,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 218 .iov_len = MSGLEN,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 219 };
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 220 struct msghdr msg = {
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 221 .msg_name = NULL,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 222 .msg_namelen = 0,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 223 .msg_iov = &iov,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 224 .msg_iovlen = 1,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 225 .msg_control = &cmsg,
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 226 .msg_controllen = CMSG_SPACE(sizeof(cmsg.fd)),
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 227 };
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 228 int ret;
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 229
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 230 ret = sendmsg(self->fd[receiver * 2 + 1], &msg, variant->flags);
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 231 ASSERT_EQ(MSGLEN, ret);
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 232 }
2aa0cff26ed53b Kuniyuki Iwashima 2024-03-25 233
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-04-15 19:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 19:22 kernel test robot [this message]
2024-04-16 5:59 ` [linux-next:master 2092/6266] scm_rights.c:203:18: warning: field 'cmsghdr' with variable sized type 'struct cmsghdr' not at the end of a struct or class is a GNU extension kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404160354.YBvIGPEM-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.