[Gnucash-changes] r13786 - gnucash/trunk - The kvp_frame_get_string() function returns a pointer to an internal

David Hampton hampton-gnucash at rainbolthampton.net
Sat Apr 15 14:44:08 EDT 2006


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




More information about the gnucash-devel mailing list