Re: [RFA] Handle GPC specific name for main function

Eli Zaretskii
2007-10-06T07:24:49Z

> 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?