This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Handle GPC specific name for main function
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: muller at ics dot u-strasbg dot fr, gdb-patches at sourceware dot org
- Date: Sat, 06 Oct 2007 09:24:28 +0200
- Subject: Re: [RFA] Handle GPC specific name for main function
- References: <001701c805a0$1da99b60$58fcd220$@u-strasbg.fr> <20071005181620.GB3570@adacore.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 5 Oct 2007 11:16:20 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> This is mostly OK. I feel like I am being a perfectionist on you,
> and I apologize, but I think I might have missed something that
> feels wrong somehow: You're having to cast your global static const
> char into (char *) inside pascal_main_name. I can tell from the code
> that everything will be fine, but perhaps we could do better. What
> do others think of this cast?
>
> static const char GPC_MAIN_PROGRAM_NAME_1[]
> = "_p__M0_main_program";
>
> char *
> pascal_main_name (void)
> {
> [...]
> return (char *) GPC_MAIN_PROGRAM_NAME_1[];
> }
Yuck! Can't we make pascal_main_name return `const char *'? If not,
why not?