From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31110 invoked by alias); 8 Oct 2007 07:35:28 -0000 Received: (qmail 31100 invoked by uid 22791); 8 Oct 2007 07:35:27 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Oct 2007 07:35:24 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id 9147718701A; Mon, 8 Oct 2007 09:40:05 +0200 (CEST) From: "Pierre Muller" To: "'Joel Brobecker'" , "'Eli Zaretskii'" Cc: References: <001701c805a0$1da99b60$58fcd220$@u-strasbg.fr> <20071005181620.GB3570@adacore.com> <20071007071713.GG3570@adacore.com> <20071008063451.GI3570@adacore.com> In-Reply-To: <20071008063451.GI3570@adacore.com> Subject: RE: [RFA] Handle GPC specific name for main function Date: Mon, 08 Oct 2007 07:35:00 -0000 Message-ID: <005801c8097d$cd45e110$67d1a330$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us 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/msg00105.txt.bz2 Hi Joel, I am sorry to be so late to reply to your comments, but I have currently no internet access at home :( About your changes: 1) Change of function type to "const char *" Chainging the return type of "pascal_main_name" to "const char *" seems fine for me, 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. My limited knowledge of the subtle differences between "const char *" and "char *" explains why I missed it at the start, but also lets me state that I have no idea if changing the return type of "ada_main_name" is correct, or if doing the typecasting on the line where "ada_main_name" is called. Wouldn't it be better to leave the new_main_name type unchanged, and do a type cast either when calling "pascal_main_name" or inside "pascal_main_name" if we decide to leave it as a "char *". 2) Your change to the final comment inside "pascal_main_name": The main point here is that this function is only useful for the GNU pascal compiler (GPC) which gives a special symbol name to the main procedure inside the main source. This is not the case for the Free Pascal compiler, another freeware, and I happen to be part of the core developer team of Free Pascal, thus your comment is misleading + /* No known entry procedure found, the main program is probably + not in pascal. */ I would propose + /* No known entry procedure found, the main program is probably + not compiled by GPC. */ Thank you very much for taking the time to review this patch, Pierre Muller Pascal language maintainer. > -----Original Message----- > From: Joel Brobecker [mailto:brobecker@adacore.com] > Sent: Monday, October 08, 2007 8:35 AM > To: Eli Zaretskii > Cc: muller@ics.u-strasbg.fr; gdb-patches@sourceware.org > Subject: Re: [RFA] Handle GPC specific name for main function > > > Fine with me; that's what I had in mind. > > Excellent. Here is the complete patch, I forgot to include the symtab.c > part... > > 2007-10-07 Pierre Muller > > * p-lang.h (pascal_main_name): Add declaration. > * p-lang.c (GPC_P_INITIALIZE, GPC_MAIN_PROGRAM_NAME_1) > (GPC_MAIN_PROGRAM_NAME_2): New constants. > (pascal_main_name): New function. > * symtab.c: Include p-lang.h. > (find_main_name): ADd call to pascal_main_name. > * Makefile.in (symtab.o): Add dependency on p-lang.h. > > Needs to be tested... > > -- > Joel