From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 457CC3857B93 for ; Wed, 15 Feb 2023 17:55:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 457CC3857B93 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 31FHtVwC016401 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Feb 2023 12:55:36 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 31FHtVwC016401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1676483736; bh=Zp3H08MI71VK9w7/ShQaDmU2wzBArBqcVJhinmqyr2Y=; h=Date:Subject:To:References:From:In-Reply-To:From; b=AZwdwTLe8aqL19hm0YMTfAQOFyt5hninJOL1TsEo/rnDx5C2eIJy1e3zSByK5uLbU Fi4Uyu+S2b8PVQTNCG1MiRLGbewYSrbriU9/wxdzhbquZzmf2w1co7Rt5KZUahFGbX oOdVwaYw4h7FwRUCEr7MsP4x54oEu4yjp/BHNu4s= Received: from [10.0.0.111] (modemcable162.249-56-74.mc.videotron.ca [74.56.249.162]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A151B1E110; Wed, 15 Feb 2023 12:55:31 -0500 (EST) Message-ID: Date: Wed, 15 Feb 2023 12:55:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH 7/8] Use @deftypefn in chew output Content-Language: fr To: Tom Tromey , binutils@sourceware.org References: <20230208071725.3668898-1-tom@tromey.com> <20230208071725.3668898-8-tom@tromey.com> From: Simon Marchi In-Reply-To: <20230208071725.3668898-8-tom@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 15 Feb 2023 17:55:31 +0000 X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/8/23 02:17, Tom Tromey wrote: > When reading the BFD info manual, function definitions looked very > strange to me: > > *Synopsis* > long bfd_get_mtime (bfd *abfd); > *Description* > Return the file modification time (as read from the file system, or from > the archive header for archive members). > > The *Synopsis* and *Description* text in particular is very un-info-like. > > To fix this, I tried removing the *Synopsis* text and having FUNCTION > use @deftypefn instead. However, this ended up requiring some new > state, because SYNOPSIS can appear without FUNCTION. This in turn > required "catstrif" (I considered adding FORTH-style if-else-then, but > in the end decided on an ad hoc approach). > > After this the result looks like: > > -- Function: long bfd_get_mtime (bfd *abfd); > Return the file modification time (as read from the file system, or > from the archive header for archive members). > > This patch also reorders a few documentation comments to ensure that > SYNOPSIS comes before DESCRIPTION. This is the more common style and > is also now required by doc.str. > > bfd/ChangeLog > 2023-02-07 Tom Tromey > > * syms.c (bfd_decode_symclass, bfd_is_undefined_symclass) > (bfd_symbol_info): Reorder documentation comment. > * doc/doc.str (synopsis_seen): New variable. > (SYNOPSIS): Set synopsis_seen. Emit @deftypefn. > (DESCRIPTION): Use synopsis_seen. > * doc/chew.c (catstrif): New function. > (main): Add catstrif intrinsic. > (compile): Recognize "variable" command. Hi Tom, Starting with this commit, I see this when building (with ASan enabled): GEN doc/aoutx.stamp ================================================================= ==45648==ERROR: LeakSanitizer: detected memory leaks Direct leak of 14 byte(s) in 1 object(s) allocated from: #0 0x7f193eebfa89 in __interceptor_malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x55a292052ba0 in xmalloc /home/smarchi/src/binutils-gdb/bfd/doc/chew.c:158 #2 0x55a29205678a in nextword /home/smarchi/src/binutils-gdb/bfd/doc/chew.c:1090 #3 0x55a292057c1e in compile /home/smarchi/src/binutils-gdb/bfd/doc/chew.c:1331 #4 0x55a292058b8b in main /home/smarchi/src/binutils-gdb/bfd/doc/chew.c:1511 #5 0x7f193ec3c78f (/usr/lib/libc.so.6+0x2378f) Simon