From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id BB15F395BC36 for ; Tue, 4 May 2021 15:53:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BB15F395BC36 Received: by mail-wr1-x434.google.com with SMTP id l13so8383112wru.11 for ; Tue, 04 May 2021 08:53:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vFudBmXu/+RTuQ8QzQZplAS5i4hzpB1lVEpniyoJ/gA=; b=cn9FcKqTM2IS2ObbxJHpWgKtLIzFbk4GFqPfmXTPt3LLA1Qe+3lkP+QqB+WbB69TY9 kN3wwmBDHVK8Z90z9qMp0wiG7GG9BkbarUtr2pQS7GXc+FTdbBGPujMkW8MyGH2gsGJ+ NCrAwKE5Zu0TAQOoTHlkX1s9gJ+MEygh0i9DEvzq35zOnEgjoMMKWPI5gy1N8hc/6Svw SqBoYvXr508G8t7TbgGqecLIN5s1T3FPIyLp4L2CK59yVttzoJpnJh/D4fu0eQKDxRXC dubPA4L2X0+nBiyeOtIRKI2IbEDkTmeMoYIL3KqofigKdJK8ZfHosWdgfKd8ySFFjj8z a0fw== X-Gm-Message-State: AOAM532nXyTSKUM7927bBz4aznxgTn4mF0l1eDnR9nnqqhN0COdCGD6f fBPGmyWWyms4jHRq8xikYa8= X-Google-Smtp-Source: ABdhPJxGOqa+8jNdMAdHPH7LCR9tXljMAkwsxkiD4yDPJsecJJJB0m5E49H7BlbrJfUni6lNjL9d0w== X-Received: by 2002:a5d:4304:: with SMTP id h4mr6125597wrq.210.1620143611803; Tue, 04 May 2021 08:53:31 -0700 (PDT) Received: from [192.168.0.237] ([170.253.36.171]) by smtp.gmail.com with ESMTPSA id f25sm17103717wrd.67.2021.05.04.08.53.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 08:53:31 -0700 (PDT) Subject: Re: [RFC v2] bpf.2: Use standard types and attributes To: Greg KH , Alexei Starovoitov Cc: "Michael Kerrisk (man-pages)" , linux-man , LKML , glibc , GCC , bpf , David Laight , Zack Weinberg , Joseph Myers References: <20210423230609.13519-1-alx.manpages@gmail.com> <20210504110519.16097-1-alx.manpages@gmail.com> From: "Alejandro Colomar (man-pages)" Message-ID: <69fb22e0-84bd-47fb-35b5-537a7d39c692@gmail.com> Date: Tue, 4 May 2021 17:53:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2021 15:53:34 -0000 Hi Greg and Alexei, > On Tue, May 04, 2021 at 07:12:01AM -0700, Alexei Starovoitov wrote: >> For the same reasons as explained earlier: >> Nacked-by: Alexei Starovoitov Okay, I'll add that. On 5/4/21 4:24 PM, Greg KH wrote:> I agree, the two are not the same type at all, this change should not be > accepted. I get that in the kernel you don't use the standard fixed-width types (with some exceptions), probably not to mess with code that relies on not being included (I hope there's not much code that relies on this in 2021, but who knows). But, there is zero difference between these types, from the point of view of the compiler. There's 100% compatibility between those types, and you're able to mix'n'match them. See some example below. Could you please explain why the documentation, which supposedly only documents the API and not the internal implementation, should not use standard naming conventions? The standard is much easier to read for userspace programmers, which might ignore why the kernel does some things in some specific ways. BTW, just to clarify, bpf.2 is just a small sample to get reviews; the original intention was to replace __uNN by uintNN_t in all of the manual pages. Thanks, Alex ... Example: $ cat test.c #include typedef int __s32; int32_t foo(void); int main(void) { return 1 - foo(); } __s32 foo(void) { return 1; } $ cc -Wall -Wextra -Werror -S -Og test.c -o test.s $ cat test.s .file "test.c" .text .globl foo .type foo, @function foo: .LFB1: .cfi_startproc movl $1, %eax ret .cfi_endproc .LFE1: .size foo, .-foo .globl main .type main, @function main: .LFB0: .cfi_startproc call foo movl %eax, %edx movl $1, %eax subl %edx, %eax ret .cfi_endproc .LFE0: .size main, .-main .ident "GCC: (Debian 10.2.1-6) 10.2.1 20210110" .section .note.GNU-stack,"",@progbits $ -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/