* [rfa] Change lbasename() to return ``const char *''
@ 2001-08-07 18:06 Andrew Cagney
2001-08-08 5:09 ` Fergus Henderson
2001-08-08 10:52 ` Richard Henderson
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cagney @ 2001-08-07 18:06 UTC (permalink / raw)
To: gcc-patches; +Cc: gdb-patches, binutils
Hello,
The attached patch changes the liberty function lbasename() so that it
returns ``const char *''.
Ok? I think I've updated/fixed all uses to reflect this.
Andrew
From ac131313@cygnus.com Tue Aug 07 20:46:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [rfc[ multi-arch TARGET_VIRTUAL_FRAME_POINTER
Date: Tue, 07 Aug 2001 20:46:00 -0000
Message-id: <3B70B5F1.9060900@cygnus.com>
X-SW-Source: 2001-08/msg00074.html
Content-length: 375
This multi-arches the method TARGET_VIRTUAL_FRAME_POINTER. tracepoint
people may want to take a quick look. I'll check it in, in a few days.
Anyway, I think the comment:
- /* Macro for getting target's idea of a frame pointer.
- FIXME: GDB's whole scheme for dealing with "frames" and
- "frame pointers" needs a serious shakedown. */
says it all.
enjoy,
Andrew
From ac131313@cygnus.com Tue Aug 07 21:09:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [rfc] revamp floatformat_{to,from}_doublest() {fetch,store}_floating()
Date: Tue, 07 Aug 2001 21:09:00 -0000
Message-id: <3B70BB80.6090203@cygnus.com>
X-SW-Source: 2001-08/msg00075.html
Content-length: 344
Hello,
Per my posts on gdb@, this patch revamps the functions
floatformat_to_doublest()
floatformat_from_doublest()
and
fetch_floating()
store_floating()
so that they all consistently try to use host and then software when
performing FP conversions.
I'll check this in in a few days (after I've also tried it on an x86 host).
Andrew
From ac131313@cygnus.com Tue Aug 07 21:20:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Jiri Smid <smid@suse.cz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA]: x86_64 target files
Date: Tue, 07 Aug 2001 21:20:00 -0000
Message-id: <3B70BDF4.8070807@cygnus.com>
References: <s8vg0baa6hb.fsf@naga.suse.cz>
X-SW-Source: 2001-08/msg00076.html
Content-length: 145
Jiri,
Can I suggest as a first step, adding your self to the MAINTAINERS file
under write-after-approval.
Sorry to sit on this one.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfa] Change lbasename() to return ``const char *''
2001-08-07 18:06 [rfa] Change lbasename() to return ``const char *'' Andrew Cagney
@ 2001-08-08 5:09 ` Fergus Henderson
2001-08-08 6:35 ` Andrew Cagney
2001-08-08 10:52 ` Richard Henderson
1 sibling, 1 reply; 5+ messages in thread
From: Fergus Henderson @ 2001-08-08 5:09 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gcc-patches, gdb-patches, binutils
On 07-Aug-2001, Andrew Cagney <ac131313@cygnus.com> wrote:
> The attached patch changes the liberty function lbasename() so that it
> returns ``const char *''.
Why? That will lead to the need for casts in the callers. Why not just
put the cast in lbasename(), like is done for strchr() in the C standard?
lbasename() is const-polymorphic, i.e. the return value should be
a const pointer iff the argument is a const pointer.
C doesn't have any good way to express the type of const-polymorphic routines.
Unless you duplicate the code in two functions, one for const pointers and one
for non-const pointers, some casting will be required.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh > | -- the last words of T. S. Garp.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfa] Change lbasename() to return ``const char *''
2001-08-08 5:09 ` Fergus Henderson
@ 2001-08-08 6:35 ` Andrew Cagney
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2001-08-08 6:35 UTC (permalink / raw)
To: Fergus Henderson; +Cc: gcc-patches, gdb-patches, binutils
> On 07-Aug-2001, Andrew Cagney <ac131313@cygnus.com> wrote:
>
>> The attached patch changes the liberty function lbasename() so that it
>> returns ``const char *''.
>
>
> Why? That will lead to the need for casts in the callers. Why not just
> put the cast in lbasename(), like is done for strchr() in the C standard?
(This was discussed once before as an RFC :-).
Why not? At present lbasename() throws away information. The thing to
remember is that lbasename() is ment to be kind of like basename() and
other (botched?) ISO/POSIX library funtions, only useful :-)
If someone really wants to blat the returned buffer let that be made
_explicit_ at the callers end. Better still, use:
xstrdup (lbasename (...))
which gives well defined semantics.
> lbasename() is const-polymorphic, i.e. the return value should be
> a const pointer iff the argument is a const pointer.
> C doesn't have any good way to express the type of const-polymorphic routines.
> Unless you duplicate the code in two functions, one for const pointers and one
> for non-const pointers, some casting will be required.
I've been through all the callers and I didn't find a single places
where a cast was needed.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfa] Change lbasename() to return ``const char *''
2001-08-07 18:06 [rfa] Change lbasename() to return ``const char *'' Andrew Cagney
2001-08-08 5:09 ` Fergus Henderson
@ 2001-08-08 10:52 ` Richard Henderson
2001-08-10 16:47 ` Andrew Cagney
1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2001-08-08 10:52 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gcc-patches, gdb-patches, binutils
On Tue, Aug 07, 2001 at 09:06:08PM -0400, Andrew Cagney wrote:
> The attached patch changes the liberty function lbasename() so that it
> returns ``const char *''.
Ok.
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [rfa] Change lbasename() to return ``const char *''
2001-08-08 10:52 ` Richard Henderson
@ 2001-08-10 16:47 ` Andrew Cagney
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2001-08-10 16:47 UTC (permalink / raw)
To: Richard Henderson; +Cc: gcc-patches, gdb-patches, binutils
> On Tue, Aug 07, 2001 at 09:06:08PM -0400, Andrew Cagney wrote:
>
>> The attached patch changes the liberty function lbasename() so that it
>> returns ``const char *''.
>
>
> Ok.
Thanks. I've checked this in - both gcc and binutils/gdb.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-08-10 16:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-07 18:06 [rfa] Change lbasename() to return ``const char *'' Andrew Cagney
2001-08-08 5:09 ` Fergus Henderson
2001-08-08 6:35 ` Andrew Cagney
2001-08-08 10:52 ` Richard Henderson
2001-08-10 16:47 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox