On Sat, 2006-04-15 at 19:23 +0100, Neil Williams wrote:
> On Saturday 15 April 2006 5:40 pm, David Hampton wrote:
> >    gnucash/trunk/lib/libqof/qof/kvp_frame.c
> >    gnucash/trunk/lib/libqof/qof/kvp_frame.h
> > Log:
> > The kvp_frame_get_string() function returns a pointer to an internal
> > string.  Mark it 'const' to prevent callers from trying to free it.
> 
> And the API clearly marks it as such - this is gnucash's error, not QOF.

I diagree 100%.  Without a const declaration the API doesn't clearly
mark this function as returning a read-only value.  You are hoping that
all developers will read your documentation instead of taking the smart
approach of having the compiler to strictly enforce the requirement.

David


_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to