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

  • From: Stefan Götz <stefan.goetz@xxxxxx>
  • To: mp+93782@xxxxxxxxxxxxxxxxxx
  • Date: Mon, 27 Feb 2012 09:46:17 -0000

Hi Xin,

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


-- 
https://code.launchpad.net/~hipl-core/hipl/libhip/+merge/93782
Your team HIPL core team is subscribed to branch lp:hipl.

Other related posts: