From: Joel Brobecker <brobecker@adacore.com>
To: Pierre Muller <muller@ics.u-strasbg.fr>
Cc: 'Eli Zaretskii' <eliz@gnu.org>, gdb-patches@sourceware.org
Subject: Re: [RFA] Handle GPC specific name for main function
Date: Mon, 08 Oct 2007 15:14:00 -0000 [thread overview]
Message-ID: <20071008151408.GN3570@adacore.com> (raw)
In-Reply-To: <005801c8097d$cd45e110$67d1a330$@u-strasbg.fr>
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
next prev parent reply other threads:[~2007-10-08 15:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-03 9:31 Pierre Muller
2007-10-05 18:16 ` Joel Brobecker
2007-10-06 7:24 ` Eli Zaretskii
2007-10-07 7:17 ` Joel Brobecker
2007-10-07 19:25 ` Eli Zaretskii
2007-10-08 6:35 ` Joel Brobecker
2007-10-08 7:35 ` Pierre Muller
2007-10-08 15:14 ` Joel Brobecker [this message]
2007-10-08 15:43 ` [RFA-2] " Pierre Muller
2007-10-08 15:45 ` Pierre Muller
2007-10-08 17:24 ` Joel Brobecker
2007-10-08 18:45 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071008151408.GN3570@adacore.com \
--to=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=muller@ics.u-strasbg.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox