Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp687700iol; Thu, 9 Jun 2022 11:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOHPghYpu47lPY3cPBy7f2fdgOwTG/gFhoPqF+kEUG1hBU/pCjYOS7zWlbqL+riKn1Y1o4 X-Received: by 2002:aa7:cf91:0:b0:431:3b5f:ecc8 with SMTP id z17-20020aa7cf91000000b004313b5fecc8mr30931792edx.306.1654800242797; Thu, 09 Jun 2022 11:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654800242; cv=none; d=google.com; s=arc-20160816; b=y1qtobUripy9VQ791pYqtcY4uD8mkc4ElYDMk5I4wZaALMlwDiuo1QvuOj9JzjJYpr A5GOhsMB3AhKDXkNi/Xfez0v80kY/4U1hYq4ARj5NA0UNiUHRccwVaYYOSHj3q9dvOya d1o4tJBcBIRjDDQ5VTZes72SGndNRs3+7skaR5ZREt0AAbnBLmZxQS4H6NvGrfdi5KtH NsnL1Iqy+0lNEU+Q+CtpOoQoETaFTqsyZDy+85CGelnMB5soF2OzolKI7ibu5qs9e2ub U/6ulmz2IGDaYfBdMF1d7DBjpTl3oCVyFMTYOi0xHCFDLsk3Qnoz6DD3ZU51k/aeqL+4 fbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wa5+7Ua+o1gsnunSmNIYAMm6Jg9lLaYkR4rgU6BaP74=; b=aPILTRImBa/pS3oeoejtLR+h1tZ6Ny2+/ilFqiOfM6ntLJ7OOeGZcybHp7vb/ay+AS JJ3JRAShA1L/srx4pIdmes3rAAXceTUXJU9k28Uz9yKWiypwgVF+9/k1/Yatuz5o3mET WGR2QHxWcAsgb8IZgC1PFKsXS3EbV2EdZt7MpcJxTvNpmM+F7Y5mRLZbpGtL8Xf4Zfy2 ceGVaAWPUhpcLC7FRzmDxXMiLjif1pI9E+K+VmxlYRVc8tJnvbs8v3UGdD53ugwgR5HG YPe4EXaU1ANibPJoaDGNptdD2NZabvTnlsQPMfluzPO4qraQugJ4f5ULAMMabqZ9Ai2b T6tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="gyS/q+Nd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a170906794b00b006fecf3cacbdsi8460926ejo.992.2022.06.09.11.43.36; Thu, 09 Jun 2022 11:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="gyS/q+Nd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345266AbiFISL6 (ORCPT + 99 others); Thu, 9 Jun 2022 14:11:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbiFISL4 (ORCPT ); Thu, 9 Jun 2022 14:11:56 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94EDFEBA89; Thu, 9 Jun 2022 11:11:55 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id w20so17576468lfa.11; Thu, 09 Jun 2022 11:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wa5+7Ua+o1gsnunSmNIYAMm6Jg9lLaYkR4rgU6BaP74=; b=gyS/q+Ndb+nVDe4qMwR01ny3c0CwbotAbR8WzWWTiRTU+dI0xvcLlNcdo9W8DKldbN xIZzvY9H7TL5LihL2SaN4Dme0knRtLU0ascZZxUQzH0hNaUDAd1ZBil3Oi0SS8Oc/3mI qhly9sIogMShRAuZHao2pMS3wvcej9HQDWp1dJppE1RJHYyBlDkzbjH2jGIcvtIGuLb+ 8QGCTMxZoHTZp02VLdsZdr0lBD9aQx4hNkPT+gD7r8pFL3xGMkTK7s926balR+mT13/O Oh/JkzQslIF7He7WdMqCer7Kvp4Sy1CNiVFN8CjJxNYKfa4nEnabPAw35yBZM2taGVzA zZJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wa5+7Ua+o1gsnunSmNIYAMm6Jg9lLaYkR4rgU6BaP74=; b=aZh0J+H/9pAVSb8jVDGa9ivpRbIq2uZV0edPFS5b+cgUzycCjoQxy9ztaMeDdhfv6X NTfv38W1MO2cM5zpSpFLJJGBXRboZKPOVJ3hvq6+6dP+6XFGS45MsgAsDh3LVoMiEG06 FVHEAgSaTOcQEw2yZKHlhNOOMsq/S8OuGk/Wdm6G0LHp4cg1BPVZUGSHYK6uaOyGFMUg R6aS4PhGFFMzrTTl8g7lHC7AyqLEcJTXUKO9b7mjYXNgw034NuqKyFT8bWZmE+rob/7N 3nEOaC0tjZQd34KtYZErrParzEuvNyib8gzP2mGmjW0aiUFIHmHZ6nzJnGNUMQnWUDnc FNFQ== X-Gm-Message-State: AOAM533nMAoBf30Dh4gSyWPnrpUPCCEFEr2ohmcucWHV40rvip14wJox 6zoJkXZQoc0QsGvtbrDtOaBiu2MgLYlWx9LlKfc65xlHolM= X-Received: by 2002:a05:6512:2296:b0:479:5805:6f05 with SMTP id f22-20020a056512229600b0047958056f05mr10801238lfu.302.1654798313751; Thu, 09 Jun 2022 11:11:53 -0700 (PDT) MIME-Version: 1.0 References: <20220609062829.293217-1-james.hilliard1@gmail.com> In-Reply-To: <20220609062829.293217-1-james.hilliard1@gmail.com> From: Andrii Nakryiko Date: Thu, 9 Jun 2022 11:11:42 -0700 Message-ID: Subject: Re: [PATCH 1/1] libbpf: replace typeof with __typeof__ for -std=c17 compatibility To: James Hilliard Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "open list:BPF (Safe dynamic programs and tools)" , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 8, 2022 at 11:28 PM James Hilliard wrote: > > Fixes errors like: > error: expected specifier-qualifier-list before 'typeof' > 14 | #define __type(name, val) typeof(val) *name > | ^~~~~~ > ../src/core/bpf/socket_bind/socket-bind.bpf.c:25:9: note: in expansion of macro '__type' > 25 | __type(key, __u32); > | ^~~~~~ > > Signed-off-by: James Hilliard > --- If you follow DPDK link you gave me ([0]), you'll see that they ended up doing #ifndef typeof #define typeof __typeof__ #endif It's way more localized. Let's do that. But also I tried to build libbpf-bootstrap with -std=c17 and immediately ran into issue with asm, so we need to do the same with asm -> __asm__. Can you please update your patch and fix both issues? [0] https://patches.dpdk.org/project/dpdk/patch/2601191342CEEE43887BDE71AB977258213F3012@irsmsx105.ger.corp.intel.com/ [1] https://github.com/libbpf/libbpf-bootstrap > tools/lib/bpf/bpf_core_read.h | 16 ++++++++-------- > tools/lib/bpf/bpf_helpers.h | 4 ++-- > tools/lib/bpf/bpf_tracing.h | 24 ++++++++++++------------ > tools/lib/bpf/btf.h | 4 ++-- > tools/lib/bpf/libbpf_internal.h | 6 +++--- > tools/lib/bpf/usdt.bpf.h | 6 +++--- > tools/lib/bpf/xsk.h | 12 ++++++------ > 7 files changed, 36 insertions(+), 36 deletions(-) > [...]