[Freeassociation-devel] Commit R981 / R903

Allen Winter winter at kde.org
Fri Mar 5 15:24:45 PST 2010


On Tuesday 22 December 2009 7:34:29 am dothebart wrote:
> libical/src/libical/ (icalattach.c icalattach.h): 
> 13:25  CIA-14: libical: * unsigned char* why?
> 13:25  CIA-14: libical: * remove const casts; this is a place where casting away const definitely gave us a bug, as fixed by Allen earlier.
> Allen, since you've fixed a crash in R903 and the experiences we've collected with libicals code so far...
> Its probably always a good idea to question the surrounding code and have a look the place where they're called.
> The caller of icalattach_new_from_data() casted away a const char* which most probably was the reason for this crash?
> so, having a look at the bigger picture around a bug often shows more places for code cleanup, or even possible removal for now abandoned code;
> maybe somewhen in the future libical will have clean code ;-)

Unfortunately, doing this changes the source and binary compatibility.
Assuming our next release is 0.45 (i.e. a point release), I don't think 
this is a good idea.

If this was C++ we could add a new overload; since it's C we need another idea.

I suggest putting back the old icalattach_new_from_data() and make a new
function called icalattach_new_from_udata().  Put a big comment in the header
that icalattach_new_from_data() is deprecated and to please use
icalattach_new_from_udata() instead.

or some-such.

comments on this?




More information about the libical-devel mailing list