From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17340 invoked by alias); 30 Aug 2010 14:58:28 -0000 Received: (qmail 17325 invoked by uid 22791); 30 Aug 2010 14:58:28 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Aug 2010 14:58:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id BDAAD2BAC11; Mon, 30 Aug 2010 10:58:21 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZFmwUnqvcU9p; Mon, 30 Aug 2010 10:58:21 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 84C8C2BAC07; Mon, 30 Aug 2010 10:58:21 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id BBA50F599F; Mon, 30 Aug 2010 16:58:15 +0200 (CEST) Date: Mon, 30 Aug 2010 14:58:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] Code cleanup: Make function typedef for find memory region Message-ID: <20100830145815.GH2986@adacore.com> References: <20100830085953.GA25961@host1.dyn.jankratochvil.net> <20100830141454.GG2986@adacore.com> <20100830142507.GA1356@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100830142507.GA1356@host1.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00517.txt.bz2 > I am also for requiring comment to be placed at the function definition and > not at its declaration. Using tag jumps one will never find the declaration > and I have considered these functions to have no comment (randomly found now > simple_displaced_step_copy_insn, it was a different function I had the problem > with). That has been my approach as well, so I'm not the one that needs convincing. However, proponents of comments with the definition also have a good point. When you have a nice public API declared in a .h file, it's convenient to have the documentation there. I still think that it's better to be consistent in the location of the documentation, particularly if the names we choose in the API are clear enough that it gives us a general idea of what each entity is about. We can then read the comment of the functions of interest. > I am also for forbidding putting comments there at both places as such way > they get inconsistent soon or they differ etc. (randomly found init_type). Agree on that as well. -- Joel