[hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl

On Mon, Feb 27, 2012 at 02:28:30PM +0200, Xin Gu wrote:
> On 27/02/12 11:46, Stefan Götz wrote:
> >your understanding is quite correct. It is simply project policy to make all 
> >data as 'const' as possible because it helps to detect bugs. For example:
> >
> >void foo(list_t *list) {
> >   if (list = NULL) {
> >     return;
> >   } else {
> >     // do stuff with list
> >   }
> >}
> >
> >cannot go unnoticed when foo is declared as 'void foo(list_t *const list)'
> >
> >So you're right: such const qualifiers are not *necessary*. But the hipl 
> >team still considers them a very good idea.
> >
> >Cheers,
> >     Stefan
> >
> >
> 
> Hi Stefan,

Please don't just bottom-post, snip your quotes appropriately instead,
thank you.

> I have one suggestion: for the function declaration in the header
> file, I suggest that we can eliminate this kind of const because it
> makes no sense for the API caller.

Having declaration and definition differ opens a very scary can of worms
IMO, let's not go down this road.  I very much miss a gcc option to
scream and shout at such abuses.

Diego

Other related posts: