gdb sources

André Pönitz apoenitz@trolltech.com
Fri Sep 19 14:13:00 GMT 2008


On Friday 12 September 2008 17:35:34 Daniel Jacobowitz wrote:
> On Fri, Sep 12, 2008 at 05:12:50PM +0200, André Pönitz wrote:
> > [...]
> > (2) Most of the "strings" in gdb are "char *", even if they are
> > conceptionally "const char *" (i.e. coming from literal, or not
> > intended to be changed). Why? In some places "const" is also
> > used, so the reason can't be "gdb supports compilers that
> > don't know about 'const'". Is it "just legacy"? If so, would patches
> > replacing "char *" by "const char *" if appropriate be welcome?
> 
> Yes, constifying patches are welcome.  It's just that gdb _used_ to
> support compilers that didn't know const, and may even predate
> const in places.

Ok. Something tiny attached for starters. It is as harmless as it can be.
I hope this is uncontroversial, but before going further into this
direction I have two related questions:

1. How would the prefered way to call, say,  xfree on a 'conceptionally const
char *' item look like? Are casts to non-const (void *) acceptable here?

2. Recording every such change in the ChangeLog basically duplicates
the work. Are there any shortcuts available/acceptable?

Andre'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1
Type: text/x-diff
Size: 2958 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080919/240d31e1/attachment.bin>


More information about the Gdb-patches mailing list