From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73048 invoked by alias); 13 Feb 2020 22:55:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 73036 invoked by uid 89); 13 Feb 2020 22:55:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=sentences, H*f:sk:55b2def X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 22:55:21 +0000 IronPort-SDR: w/MmDQi5wJzdrMqwUVZeTC3tEuFc9GzdZYyJEwaZcRXoPZu11xJ7C8+IQV5mAP1hFCjPlnMF3y ZLZIwhHTBBoBbYgoLr97ZLGQVoO/yA4/xvHBhQL9BITuQJAPz57JrZPfoBUjiNfZttNNagMXeN moeUEdx/XX4ZSBU3jfqhjgNOSVgUSTP9mRN/linDPkdxKr+9/TYPrrFeu5Ui8ueHixFwuKFGUU ODmxg5e9E8/z/8iCwq0Z0p+VkdM7Ipf/DrYn1tUWfnUTHc5THHGxOAEVY/uxGoQR4dmIsYjuva p+0= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 13 Feb 2020 14:55:20 -0800 IronPort-SDR: jarJnukFZThuVlTzbrQliseUDAR0FIDe11Kjv2CoZwShNKvB3TSe9URSZxOC60zyhjnJwGAv8E MrOGck6WiwDYOBj+Msyfg8InKcTFM9qWx1UrCB4+7SHewKHh9WhVlr5mIJJsGfUb0LwcXUd4ZZ 3HgQ/9BxhuNNu/PUTI52dbvtfqgQIhVSWeYLMcOwCq8j9TJUhmX6zW+S27xHRfXNkwloMTrVLA /BCDMJIKJmE7VjneFnn7VqbmB8qtLvuf8kufbGrq76qhQcjM8VhfZ8DsJVAVH25h9fnOiyR/aY 4Co= Subject: Re: [PATCH] document that alias and target must have the same type To: Martin Sebor , gcc-patches Newsgroups: gmane.comp.gcc.patches References: <850a7bd4-9759-eb9e-54ac-e3022b2fcb83@gmail.com> <55b2def7-1510-c54e-5089-509cdcf1d689@gmail.com> From: Sandra Loosemore Message-ID: <85d28ca7-bc65-ce67-ba1f-60e30fc376b5@codesourcery.com> Date: Thu, 13 Feb 2020 22:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <55b2def7-1510-c54e-5089-509cdcf1d689@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-Path: sandra@codesourcery.com X-SW-Source: 2020-02/txt/msg00818.txt.bz2 On 2/5/20 1:13 PM, Martin Sebor wrote: > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index ec99c38a607..3634ce1c423 100644 > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -2557,8 +2557,11 @@ __attribute__ ((access (write_only, 1, 2), access (read_write, 3))) int fgets (c > > @item alias ("@var{target}") > @cindex @code{alias} function attribute > -The @code{alias} attribute causes the declaration to be emitted as an > -alias for another symbol, which must be specified. For instance, > +The @code{alias} attribute causes the declaration to be emitted as an alias > +for another symbol, which must have been previously declared with the same > +type, and for variables same size and alignment. Declaring an alias with > +a different type than the target is undefined and may be diagnosed. For > +instance, an alias for another symbol, which must be specified. For instance, > > @smallexample > void __f () @{ /* @r{Do something.} */; @} This is kind of garbled. Do you have an extraneous sentence beginning "For instance" in there? It doesn't flow from the text you added before that. > @@ -3919,31 +3922,41 @@ results in warning on line 5. > > @item weak > @cindex @code{weak} function attribute > -The @code{weak} attribute causes the declaration to be emitted as a weak > -symbol rather than a global. This is primarily useful in defining > -library functions that can be overridden in user code, though it can > -also be used with non-function declarations. Weak symbols are supported > -for ELF targets, and also for a.out targets when using the GNU assembler > -and linker. > +The @code{weak} attribute causes a declaration of an external symbol > +to be emitted as a weak symbol rather than a global. This is primarily > +useful in defining library functions that can be overridden in user code, > +though it can also be used with non-function declarations. The overriding > +symbol must have the same type, and for variables size, and alignment as > +the weak symbol. Weak symbols are supported for ELF targets, and also for > +a.out targets when using the GNU assembler and linker. The "for variables" clause is awkward and has a comma in the wrong place. I'd split this into a separate sentence, like The overriding symbol must have the same type as the weak symbol. If it is a variable it must also have the same size and alignment. > @item weakref > @itemx weakref ("@var{target}") > @cindex @code{weakref} function attribute > The @code{weakref} attribute marks a declaration as a weak reference. > Without arguments, it should be accompanied by an @code{alias} attribute > -naming the target symbol. Optionally, the @var{target} may be given as > -an argument to @code{weakref} itself. In either case, @code{weakref} > -implicitly marks the declaration as @code{weak}. Without a > -@var{target}, given as an argument to @code{weakref} or to @code{alias}, > -@code{weakref} is equivalent to @code{weak}. > +naming the target symbol. Alernatively, @var{target} may be given as s/Alernatively/Alternatively/ > +an argument to @code{weakref} itself, naming the target definition of > +the alias. The the @var{target} must have the same type, and for s/The the/The/ > +variables also the same size and alignment as the declaration. In either Same comments above re splitting this into two sentences to avoid awkward wording. The rest of this patch looks OK. -Sandra