Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3911120pxy; Tue, 4 May 2021 12:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFLZ+wWt3g6zVHnrek/uX9rNnAWcE9Lh6r8en9Qvmqdg1maEpnkVOZD0dTuG8XqlXP/3SU X-Received: by 2002:a05:6402:270b:: with SMTP id y11mr9822593edd.332.1620157746439; Tue, 04 May 2021 12:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620157746; cv=none; d=google.com; s=arc-20160816; b=J1LBJo3nGn07/n5S8pXGgXexwSZ69XxDaTJraevhj62/UFO11JJAZRNvtCTAmF/wdp LAi+WtYCbUvRlU6k8eXOU0v6irvShEY1GSmiLiI1RYauylKU/yA4ttTW+4OOzer6viJE crE5O/25aXPJ1BKzTTb3vaffgmz/w5UllPyye1h0QkMOHHCq9kGwpAZwZoE871iHnCAG /9nesITFzvp7nffCspfyN2QMy5YAoKhNuGS31AmOk7kNss3hhOyiNegvi3fJRpKPh2dY /qMHkDL96IA86INAkrCSiT5D7fPsS6QQrENBvvHu0Pb0sDBJqXwPCRUL+DX2O/LcyIej 09Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=tfzPIb13S4HHhK8UG3dOlIDhClIn947SERNDpuf2glM=; b=nBbC+yFsnIjDljODFJMOXs8xQ4Bx1Ihxum3jNgRqK5Lo0bg6jifONl/O+riEPoJL/g zTQ9T/U0KJ3zEYpj6Y4rw8UWNkgIeSlBEGrjWjl1HSpqaIwPTnxm60rDOQXUcpvwhzfB Mcsk5ZTMU3sqhzkrYacMHAcJDBlE6APCoqVO2154rBL2clccU6dsTwXp2ymMCmy2CqfQ NWBD08w865wLW/NmAS5tSdCtg8CZYWF0oBUeE8Ue6uN6ORPJCCQUG5nzRt1wK0igIeNM hjWPbWPfc04tt9xBiKzN+drfHV5n47+Lxfn51h3skl7mTE3kmuJThQ/q/GllKCW3uXl5 7xCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aRS34sM2; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si3563682ejy.319.2021.05.04.12.48.31; Tue, 04 May 2021 12:49:06 -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=@redhat.com header.s=mimecast20190719 header.b=aRS34sM2; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbhEDTqV (ORCPT + 99 others); Tue, 4 May 2021 15:46:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34941 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232535AbhEDTqU (ORCPT ); Tue, 4 May 2021 15:46:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620157525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tfzPIb13S4HHhK8UG3dOlIDhClIn947SERNDpuf2glM=; b=aRS34sM2B2HFZ5xwWaxCXAzCsTbjORkzDMaU7qddkENRmuRnJIJ55t72SG4DGSOnzU1XA7 D7rRgaB1+QQ6x+VqbvGAsihtGXfRDf2dwtJ/UQFmcvHgWx1zYWE89CWQDF5IxyxTKecnto g0Qy/3eciQsJJ1ARiKsxjHOrFgYf+5g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-95LXqmt8NnO-MJdM86Agog-1; Tue, 04 May 2021 15:45:21 -0400 X-MC-Unique: 95LXqmt8NnO-MJdM86Agog-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5D53801B13; Tue, 4 May 2021 19:45:19 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1088E5C1B4; Tue, 4 May 2021 19:45:15 +0000 (UTC) From: Florian Weimer To: "Alejandro Colomar (man-pages)" Cc: Zack Weinberg , Greg KH , Daniel Borkmann , Alexei Starovoitov , "Michael Kerrisk (man-pages)" , linux-man , LKML , glibc , GCC , bpf , Joseph Myers , David Laight Subject: Re: [RFC v2] bpf.2: Use standard types and attributes References: <20210423230609.13519-1-alx.manpages@gmail.com> <20210504110519.16097-1-alx.manpages@gmail.com> <69fb22e0-84bd-47fb-35b5-537a7d39c692@gmail.com> <6740a229-842e-b368-86eb-defc786b3658@gmail.com> Date: Tue, 04 May 2021 21:45:31 +0200 In-Reply-To: <6740a229-842e-b368-86eb-defc786b3658@gmail.com> (Alejandro Colomar's message of "Tue, 4 May 2021 20:54:07 +0200") Message-ID: <87r1imgu5g.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Alejandro Colomar: > The thing is, in all of those threads, the only reasons to avoid > types in the kernel (at least, the only explicitly > mentioned ones) are (a bit simplified, but this is the general idea of > those threads): > > * Possibly breaking something in such a big automated change. > * Namespace collision with userspace (the C standard allows defining > uint32_t for nefarious purposes as long as you don't include > . POSIX prohibits that, though) > * Uglier __u64 can't be formatted with %llu on all architectures. That's not true for uint64_t, where you have to use %lu on some architectures to avoid compiler warnings (and technically undefined behavior). There are preprocessor macros to get the expected format specifiers, but they are clunky. I don't know if the problem applies to uint32_t. It does happen with size_t and ptrdiff_t on 32-bit targets (both vary between int and long). Thanks, Florian