From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by sourceware.org (Postfix) with ESMTPS id 197BA3865492 for ; Fri, 2 Oct 2020 08:24:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 197BA3865492 Received: by mail-wm1-x344.google.com with SMTP id w2so731916wmi.1 for ; Fri, 02 Oct 2020 01:24:42 -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=uepnmvkaBYFWZFNuqOI3SwkTneUXrVb8dyGb7Wp5nmM=; b=EQAsusfrXFLitC4inb9+PESgwrevwH3SGulo7hIw0UAO307pcjI1NQYEu+heTXI6dY TCEpXbgxVSgMnivSHNc9pPDYssTwwA3pxNDledDqZsF1KVdJZpzvQ1hPd0nbLpmH3iaH vclk04ZKMGH/M0MadGEXG0udEmBoSi8a9dL0kuWXs6AdltIAq/ZQ/XP+3EmwCnNqeEhs /IhPrm2GTM0vYjylLf0Y4rggv/FCjafMqbfP/D0md/BkB1UYccAOPHJheMT4OEsPpO8n TEhy8RpEyr1v570JLeWTR1kzpzCoKQQUdIFC6ah9iq18xS5KBLGGqRkR+vNmasGMtD58 uuzw== X-Gm-Message-State: AOAM533vix6GXWDQXaQZxyqPoVMRG7pURysk91F+FN1O+Tb24RO+4pcW 8Z6V6ESSsfow1ZAWZmI8DFw= X-Google-Smtp-Source: ABdhPJzJ6/QDMUZwbNSfl/vi9c5VAWusWGQJp8tIld00GRV3yGHvAK35ofyqOe1YWmNaK3fY5LEKlg== X-Received: by 2002:a1c:f311:: with SMTP id q17mr1630701wmq.168.1601627081017; Fri, 02 Oct 2020 01:24:41 -0700 (PDT) Received: from [192.168.1.143] ([170.253.60.68]) by smtp.gmail.com with ESMTPSA id l4sm1047135wrc.14.2020.10.02.01.24.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Oct 2020 01:24:40 -0700 (PDT) Subject: Re: [PATCH v2 1/2] system_data_types.7: Add 'void *' To: Paul Eggert Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org, gcc@gcc.gnu.org, "linux-kernel@vger.kernel.org" References: <41affebd-3354-9420-0048-bffd14535e95@gmail.com> <20201001154946.104626-2-colomar.6.4.3@gmail.com> <538b683f-01d2-6148-4f1d-1b293eb5cd6b@cs.ucla.edu> From: Alejandro Colomar Message-ID: <4b86f6e9-0d8a-f14a-73ce-ebbdc9d9edba@gmail.com> Date: Fri, 2 Oct 2020 10:24:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <538b683f-01d2-6148-4f1d-1b293eb5cd6b@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 08:24:43 -0000 Hi Paul, On 2020-10-01 19:32, Paul Eggert wrote: > If you're going to document this at all, I suggest documenting 'void' as > well as 'void *', and putting both sets of documentation into the same > man page. > All the types we're documenting are in the same page: system_data_types(7). And then we have links with the name of each type. And yes, I also pretend to document 'void'. > For 'void *' you should also mention that one cannot use arithmetic on > void * pointers, so they're special in that way too. Good suggestion! > Also, you should > warn that because one can convert from any pointer type to void * and > then to any other pointer type, it's a deliberate hole in C's > type-checking. Also good. I'll talk about generic function parameters for this. > It might not also hurt to mention 'void const *', 'void > volatile *', 'void const volatile *', etc. Those are qualifiers for the type, and I don't see how any of them would apply differently to 'void *' than to any other pointer type (or any type at all), so I think they don't belong to system_data_types(7). However, it might be good that someone starts a page called 'type_qualifiers(7)' or something like that. I would love that someone documents 'volatile' correctly, as there aren't many good sources about it. If someone who knows when to use --and especially when not to use-- 'volatile', is reading this, think about it :-) I still wonder if I used it correctly in the few cases I've had to. BTW, I'll CC the LKML. > > For 'void' you can mention the usual things, such as functions returning > void, and functions declared with (void) parameters, why one would want > to cast to (void), and so forth. Yes, I was thinking about that. > > You're starting to document the C language here, and if you're going to > do that you might as well do it right. I'm trying to do so :) Thanks, Alex