Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4422728pxk; Wed, 30 Sep 2020 02:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNUZB35cIGc/wT8l/OUG7AMkyJrpWLkl+6dr2FJHVdVnWKo2Ph7pTf4lXFMvNFbk1/LQJ2 X-Received: by 2002:a05:6402:1859:: with SMTP id v25mr1757475edy.118.1601458270753; Wed, 30 Sep 2020 02:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601458270; cv=none; d=google.com; s=arc-20160816; b=u41Jh95nAOmMg2nfrQosuMyoJjWHu8I0E2Sev2XipORYOW8ktvo+/cGcmTdMztvd5p ApwB4dNZ5m6LfYqdX5eYi5T76z07KocX9yO2wRfjyQ6xISnWgR2B+tDUnaJj1VD1Zk1C BbhUM5t9ZaTEhtUJQifmeRcagIHVsjGZmJSlm9LXw8ozKZL2+r5mA973vv4BhGita0Dw 3+2TmDhbk4Qh7T+EYyTvmZ4IGDKlDmuO/nixli8HYYHeAhvJ1DRAVA9Bhfvh7Bmudutd 6dWUKIjeMNOGVSg/VTCc5kxdPMdgjmN2InR/goBKmr6QVOvuypeiijJOi/NXfAcath5l WLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FCLVZ13s2A1DgySuwXRnxGS7cpstquPbJaPgNjBvO64=; b=DdrnFDuuRMFXI9RxOTKpmu+agRiujPqtGf2z6a9PitSGfUnFYkH4Rn8X3eP6X8NoKO UeK5s61Zm6wnGDfeaxk18dmeGf0Ikb/dtDdS/pggOs3WfqCS4ikbLNOB6bu8b/kWpwfY oHOxzncSjSOqXevUzu1MGYmu5z7I58YjzNi113oP+i8lHvxIKndf9lhQZwVUZiHEfaTq 0Uz22ncCa0PFhuCtz5wWU5ofc53GTrKSE7iClK0qGdam+Sg6qpeq06tbdLgl4q7DkRtF zYJA6dlBHEyePUiT9PYGOYCD6F0ajq9r4KGKtZCeYwt877W/UXyaQkCqAYHxOug/7Mjc xtyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=Nf+iXt9Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oq9si777669ejb.185.2020.09.30.02.30.46; Wed, 30 Sep 2020 02:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=Nf+iXt9Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728149AbgI3J2p (ORCPT + 99 others); Wed, 30 Sep 2020 05:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbgI3J2p (ORCPT ); Wed, 30 Sep 2020 05:28:45 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA12C0613D1 for ; Wed, 30 Sep 2020 02:28:45 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id o8so1164776otl.4 for ; Wed, 30 Sep 2020 02:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FCLVZ13s2A1DgySuwXRnxGS7cpstquPbJaPgNjBvO64=; b=Nf+iXt9Q+W3wuykljBC0zdhMYnMqxjUojtb8TRh4984evIAub+t9Qi9FyokxlZVkz1 JgGp1og7inZFVLDQee/ePVlah3cclhQZicb4KltFZ3hGwtbIsFDjlm1QCDOfy4+Y9eE3 CSrLDPdSvfT1RcbZ/GbrmHhOxXlminFXHfhXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FCLVZ13s2A1DgySuwXRnxGS7cpstquPbJaPgNjBvO64=; b=AB8zerptgi51hdJgCef5TkLMtHud37q6InU59ugd0fbevz0c2Mb6CE+f2VJc77jPGM Z56dziwI7POzppBlR3mqTVGlewCCzZE4kkyKjRW7CGVDK3VbLhE3jEr5z6Y1PHmAfiJr ARDnn1cEaFMzNwE/Dn6q8uLMbQGwF0hNlEqmFMeSEGo7+jgLftC+kzeFhrmc98MMupK4 OC1h4egZAQ+w3+IUSrm9bzS4OxMooEZKlBGQXWkeffDmKX+/1r4C7jEhUMIu7IKurHHD xOhGFjMVF8V+7kKKBpL1brQZsd2yAtYL9edVXS4rjGJSXNuZHr8E9GmjQEXWTBMus8M6 yCVQ== X-Gm-Message-State: AOAM531xJ0X0QjG4wMgztZu6SNznxnYtEqCahoBMDfpR+w7Xn1cBABsp qWghH1Il0ybaXTIqeQNWRbviB+RugY3AsmGDL5xLYA== X-Received: by 2002:a05:6830:12c7:: with SMTP id a7mr1025005otq.334.1601458124389; Wed, 30 Sep 2020 02:28:44 -0700 (PDT) MIME-Version: 1.0 References: <20200928090805.23343-1-lmb@cloudflare.com> <20200928090805.23343-3-lmb@cloudflare.com> <20200929055851.n7fa3os7iu7grni3@kafai-mbp> In-Reply-To: From: Lorenz Bauer Date: Wed, 30 Sep 2020 10:28:33 +0100 Message-ID: Subject: Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies To: Alexei Starovoitov Cc: Martin KaFai Lau , Shuah Khan , Alexei Starovoitov , Daniel Borkmann , kernel-team , "open list:KERNEL SELFTEST FRAMEWORK" , Network Development , bpf , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Sep 2020 at 16:48, Alexei Starovoitov wrote: ... > There was a warning. I noticed it while applying and fixed it up. > Lorenz, please upgrade your compiler. This is not the first time such > warning has been missed. I tried reproducing this on latest bpf-next (b0efc216f577997) with gcc 9.3.0 by removing the initialization of duration: make: Entering directory '/home/lorenz/dev/bpf-next/tools/testing/selftests= /bpf' TEST-OBJ [test_progs] sockmap_basic.test.o TEST-HDR [test_progs] tests.h EXT-OBJ [test_progs] test_progs.o EXT-OBJ [test_progs] cgroup_helpers.o EXT-OBJ [test_progs] trace_helpers.o EXT-OBJ [test_progs] network_helpers.o EXT-OBJ [test_progs] testing_helpers.o BINARY test_progs make: Leaving directory '/home/lorenz/dev/bpf-next/tools/testing/selftests/= bpf' So, gcc doesn't issue a warning. Jakub did the following little experiment: jkbs@toad ~/tmp $ cat warning.c #include int main(void) { int duration; fprintf(stdout, "%d", duration); return 0; } jkbs@toad ~/tmp $ gcc -Wall -o /dev/null warning.c warning.c: In function =E2=80=98main=E2=80=99: warning.c:7:2: warning: =E2=80=98duration=E2=80=99 is used uninitialized in= this function [-Wuninitialized] 7 | fprintf(stdout, "%d", duration); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The simple case seems to work. However, adding the macro breaks things: jkbs@toad ~/tmp $ cat warning.c #include #define _CHECK(duration) \ ({ \ fprintf(stdout, "%d", duration); \ }) #define CHECK() _CHECK(duration) int main(void) { int duration; CHECK(); return 0; } jkbs@toad ~/tmp $ gcc -Wall -o /dev/null warning.c jkbs@toad ~/tmp $ Maybe this is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D18501 ? The problem is still there on gcc 10. Compiling test_progs with clang does issue a warning FWIW, but it seems like other things break when doing that. -- Lorenz Bauer | Systems Engineer 6th Floor, County Hall/The Riverside Building, SE1 7PB, UK www.cloudflare.com