From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26597 invoked by alias); 8 Oct 2007 15:14:17 -0000 Received: (qmail 26587 invoked by uid 22791); 8 Oct 2007 15:14:17 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Oct 2007 15:14:13 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 67C992AC2C6; Mon, 8 Oct 2007 11:14:11 -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 2mYI4GCu19eY; Mon, 8 Oct 2007 11:14:11 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2C0712AC335; Mon, 8 Oct 2007 11:14:11 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id EC8C2E7B58; Mon, 8 Oct 2007 08:14:08 -0700 (PDT) Date: Mon, 08 Oct 2007 15:14:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: 'Eli Zaretskii' , gdb-patches@sourceware.org Subject: Re: [RFA] Handle GPC specific name for main function Message-ID: <20071008151408.GN3570@adacore.com> References: <001701c805a0$1da99b60$58fcd220$@u-strasbg.fr> <20071005181620.GB3570@adacore.com> <20071007071713.GG3570@adacore.com> <20071008063451.GI3570@adacore.com> <005801c8097d$cd45e110$67d1a330$@u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <005801c8097d$cd45e110$67d1a330$@u-strasbg.fr> User-Agent: Mutt/1.4.2.2i 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: 2007-10/txt/msg00161.txt.bz2 Hi Pierre, Nothing like refreshing my confused knowledge of const-ification in C while admiring the sunrise :). I'm an Ada programer more than a C programer, so I hope I haven't contributed to your confusion. > 1) Change of function type to "const char *" > Chainging the return type of > "pascal_main_name" to "const char *" seems fine for me, And that's actually what we should do. I suggested "const char const *", but in fact, I don't know what I was thinking, the latter is equivalent. So just change the return type of function pascal_main_name to "const char *". You'll need to adjust the type of new_main_name in find_main_name to "const char *" too. This is match the type returned by your function. It is fine to leave ada_main_name return "char *" for now, I will adjust it as a separate patch later > but in the function "find_main_name", there is first a call to > ada_main_name which is a "char *" function, and is now assigned to a > "const char *", as you changed the type of "new_main_name" variable. As said above, this should be fine. All we're doing when we say that new_main_name is a "const char *" is that the contents of new_main_name must not be changed. The compiler will check that for us. Assigning a "char *" to new_main_name does not violate this restriction. > + /* No known entry procedure found, the main program is probably > + not compiled by GPC. */ This is fine as well. -- Joel