This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]