From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C81DC04A6A for ; Fri, 28 Jul 2023 00:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbjG1AoG (ORCPT ); Thu, 27 Jul 2023 20:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbjG1AoB (ORCPT ); Thu, 27 Jul 2023 20:44:01 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A5B035AB for ; Thu, 27 Jul 2023 17:43:53 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-348de7bc865so963225ab.0 for ; Thu, 27 Jul 2023 17:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1690505032; x=1691109832; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=s/aJ9ksmeVttXwGKwUVAJi8p79DGJB0zVa/mu7nUe/g=; b=arbI1nple3pEZAfWdlLMRZfRSr+OZ67LXd6z/b2gt4LbN37fvQgaP9XQwqxKJBSgE3 hzhmxZkSnXVRLJHfKccq3tDsK03dmoanQxj8VlhBZneW6edBniqML4RUffXiwCxOQCWv HYKAv3b9AUgVD9Gh7ex2kWFPd43Y6a+PRp6AU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690505032; x=1691109832; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s/aJ9ksmeVttXwGKwUVAJi8p79DGJB0zVa/mu7nUe/g=; b=ZCWoDXG2czcE/OgC1TmK5r19pvnNJiXFiEqjvVvaUZUpfBMPPQ3zoRG0oQT8Lg0fFJ xJOtXjB5pph+DNIYgVKO9VINCBSoo8/v1ia5cQY4gEknjqhc7GAPoAJZ48oLxBRrs3/p q7nPvpFULT043QKYTRFwelXHC8cG25MIWVc2GonB9bQCv6/jtDoC7d0LBBDEruAOqAxo f9t2HRwH10D17eqKJCo05/9+0VM76zMjYZxi8VZV4SUj9MWxxGstJf9qBxdTM4WfvSuo 7XNLROvvjapFQABeT2NrK/HT5lzxUdbRrGeq0GY9hQ30bdJYPvAfo0md7eXDevL67xp2 IweA== X-Gm-Message-State: ABy/qLa5Zdn5HHmWcsNSwSD23/8RXPGnJZ9qiPrBkVd2KCSAQZEtR0+a X5qO6kyOUlne316aqghmCm05ig== X-Google-Smtp-Source: APBJJlHMMHqQCxm2X2zkZFYxUgIYIuXPx75dCbAYes3sMd2B8DNQk7mPNm5UaVFKmII9KL1Dl1Wq6w== X-Received: by 2002:a05:6602:1694:b0:780:cb36:6f24 with SMTP id s20-20020a056602169400b00780cb366f24mr1268855iow.2.1690505032517; Thu, 27 Jul 2023 17:43:52 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id g22-20020a056602249600b0077e3acd5ea1sm762425ioe.53.2023.07.27.17.43.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jul 2023 17:43:52 -0700 (PDT) Message-ID: <799d6088-e28f-f386-6a00-2291304171a2@linuxfoundation.org> Date: Thu, 27 Jul 2023 18:43:51 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: selftests: connector: proc_filter.c:48:20: error: invalid application of 'sizeof' to an incomplete type 'struct proc_input' To: Anjali Kulkarni , Naresh Kamboju Cc: "open list:KERNEL SELFTEST FRAMEWORK" , open list , "lkft-triage@lists.linaro.org" , Netdev , clang-built-linux , Shuah Khan , Anders Roxell , "David S. Miller" , Liam Howlett , Shuah Khan References: Content-Language: en-US From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/23 11:34, Anjali Kulkarni wrote: > > >> On Jul 25, 2023, at 9:48 AM, Anjali Kulkarni wrote: >> >> >> >>> On Jul 25, 2023, at 6:05 AM, Naresh Kamboju 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 >>> >>> 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