Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Anjali Kulkarni <anjali.k.kulkarni@oracle.com>,
	Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: "open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"lkft-triage@lists.linaro.org" <lkft-triage@lists.linaro.org>,
	Netdev <netdev@vger.kernel.org>,
	clang-built-linux <llvm@lists.linux.dev>,
	Shuah Khan <shuah@kernel.org>,
	Anders Roxell <anders.roxell@linaro.org>,
	"David S. Miller" <davem@davemloft.net>,
	Liam Howlett <liam.howlett@oracle.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: selftests: connector: proc_filter.c:48:20: error: invalid application of 'sizeof' to an incomplete type 'struct proc_input'
Date: Thu, 27 Jul 2023 18:43:51 -0600	[thread overview]
Message-ID: <799d6088-e28f-f386-6a00-2291304171a2@linuxfoundation.org> (raw)
In-Reply-To: <BB43F17E-EC00-4E72-BB3D-F4E6FA65F954@oracle.com>

On 7/27/23 11:34, Anjali Kulkarni wrote:
> 
> 
>> On Jul 25, 2023, at 9:48 AM, Anjali Kulkarni <Anjali.K.Kulkarni@oracle.com> wrote:
>>
>>
>>
>>> On Jul 25, 2023, at 6:05 AM, Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
>>>
>>> selftests: connector: proc_filter build failed with clang-16 due to below
>>> warnings / errors on Linux next-20230725.
>>>
>>> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
>>>
>>> clang --target=aarch64-linux-gnu -fintegrated-as
>>> -Werror=unknown-warning-option -Werror=ignored-optimization-argument
>>> -Werror=option-ignored -Werror=unused-command-line-argument
>>> --target=aarch64-linux-gnu -fintegrated-as -Wall proc_filter.c -o
>>> /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/connector/proc_filter
>>> proc_filter.c:42:12: error: invalid application of 'sizeof' to an
>>> incomplete type 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^~~~~~~~~~~~~~~
>>> proc_filter.c:22:5: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^ ~~~~~~~~~~~~~~~~~~~
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:48:20: error: invalid application of 'sizeof' to an
>>> incomplete type 'struct proc_input'
>>> hdr->nlmsg_len = NL_MESSAGE_SIZE;
>>> ^~~~~~~~~~~~~~~
>>> proc_filter.c:22:5: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^ ~~~~~~~~~~~~~~~~~~~
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:64:14: error: invalid application of 'sizeof' to an
>>> incomplete type 'struct proc_input'
>>> msg->len = sizeof(struct proc_input);
>>> ^ ~~~~~~~~~~~~~~~~~~~
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:65:35: error: incomplete definition of type 'struct proc_input'
>>> ((struct proc_input *)msg->data)->mcast_op =
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:66:31: error: incomplete definition of type 'struct proc_input'
>>> ((struct proc_input *)pinp)->mcast_op;
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:67:35: error: incomplete definition of type 'struct proc_input'
>>> ((struct proc_input *)msg->data)->event_type =
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:68:31: error: incomplete definition of type 'struct proc_input'
>>> ((struct proc_input *)pinp)->event_type;
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>>> char buff[NL_MESSAGE_SIZE];
>>> ^
>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>>> sizeof(struct proc_input))
>>> ^
>>> proc_filter.c:245:20: error: variable has incomplete type 'struct proc_input'
>>> struct proc_input input;
>>> ^
>>> proc_filter.c:245:9: note: forward declaration of 'struct proc_input'
>>> struct proc_input input;
>>> ^
>>> proc_filter.c:264:22: error: use of undeclared identifier
>>> 'PROC_EVENT_NONZERO_EXIT'
>>> input.event_type = PROC_EVENT_NONZERO_EXIT;
>>> ^
>>> 9 errors generated.
>>> make[4]: Leaving directory '/builds/linux/tools/testing/selftests/connector’
>>>
>>>
>> These are expected since you need to have the changes in kernel that were committed with this patch to be installed on the kernel on which this is being compiled/run on. That is what the test is for, and the check to make it run on previous kernels as well was made a runtime check. Do you expect this to compile on a kernel without the corresponding kernel changes that were committed with this patch?
>>
>> Anjali
> 
> Gentle ping -  could you answer above questions?
>>

I am seeing the same on linux-next next-20230727

PROC_EVENT_NONZERO_EXIT is defined and NL_MESSAGE_SIZE

Anjali,

What are the dependent commits and should they be in next?
Shouldn't this test patch go with the kernel patches it depends
on? Can you do some testing on next and let me know why this
test is failing to build?

It is failing for me for sure.

There could be problem in the test Makefile that it isn't including
the right headers.

thanks,
-- Shuah

thanks,
-- Shuah


  reply	other threads:[~2023-07-28  0:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 13:05 selftests: connector: proc_filter.c:48:20: error: invalid application of 'sizeof' to an incomplete type 'struct proc_input' Naresh Kamboju
2023-07-25 16:48 ` Anjali Kulkarni
2023-07-27 17:34   ` Anjali Kulkarni
2023-07-28  0:43     ` Shuah Khan [this message]
2023-07-28  1:38       ` Anjali Kulkarni
2023-07-28  2:43         ` Jakub Kicinski
2023-07-28 16:46           ` Anjali Kulkarni
2023-07-28 17:34             ` Shuah Khan
2023-07-28 18:08               ` Anjali Kulkarni
2023-07-28 17:33         ` Shuah Khan
2023-07-28 18:13           ` Anjali Kulkarni

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=799d6088-e28f-f386-6a00-2291304171a2@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=anders.roxell@linaro.org \
    --cc=anjali.k.kulkarni@oracle.com \
    --cc=davem@davemloft.net \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=llvm@lists.linux.dev \
    --cc=naresh.kamboju@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox