This is the mail archive of the gdb@sources.redhat.com 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: suggested compile warnings


On Fri, 23 May 2003 16:15:56 -0400, Andrew Cagney <ac131313@redhat.com> said:


-Wwrite-strings
It's just hard and really messy.  People occasionally chip away at the
edges.  Last time I tried, I came across what appeared to be an
effective xfree("string"), outch!

Just to clarify something. The code I came across appeared to be xfreeing a string that had never been allocated - that's seriously broken!


The xfree issue is an interesting one, and I agree that it's another
root problem.  My attitude is actually that xfree should take a const
void * instead of just a void *.  Basically, it seems to me that being
writeable and beeing freeable are orthogonal; examples are:

Many fixes are possible without fixing decode_line_1. The trick is knowing when a change is turning into a rat hole.


Andrew



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