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

Neil Williams linux at codehelp.co.uk
Sat Apr 15 14:50:51 EDT 2006


On Saturday 15 April 2006 7:44 pm, David Hampton wrote:
> 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.
>

Maybe, and I'll probably review it during the transition but right now, that 
is the QOF API. I didn't make that choice.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060415/b835ad35/attachment.bin


More information about the gnucash-devel mailing list