On Fre, 2008-02-29 at 11:11 +0100, Hannes Gredler wrote:
> hi erik,
> 
> tx for the FB ... i'll fixup the outstanding issues, run some more tests
> and will put it into the repo in about a week or so.
> 
> /hannes
> 
> On Thu, Feb 28, 2008 at 08:51:54PM +0100, Erik Tromp wrote:
> | Hi Hannes,
> | 
> | I just did a quick test of your timer refactoring code. Good work!
> | The code looks very clean which is often a good indication.
> |
> | Just a few small issues.
> | 
> | As so often, some build problems :-(
> | 
> | root@IsdbServer:/home/erik/Repositories/gredler.at/olsrd# make build_all
> | [...]
> | src/link_set.c: In function `get_best_link_to_neighbor':
> | src/link_set.h:125: warning: inlining failed in call to `list2link'
> | src/link_set.c:237: warning: called from here

Which hardware/CPU BTW?
That is very probably triggered by the "-finline-limit=50" + "-Winline".
And
----  snip  ----
#define LISTNODE2STRUCT(funcname, structname, listnodename) \ 
static inline structname * funcname (struct list_node *ptr)\ 
{\ 
  if (ptr) {\ 
    return((structname *) (((olsr_u8_t *) ptr) - offsetof(structname, listnodename))); \ 
  } \ 
  return(NULL); \ 
} 
----  snip  ----
apparently may generate more the "50" (whatever units gcc defines this
to bet).
Though I can't really understand why (basically) "return ptr != NULL ?
ptr - constant : NULL" should generate that much code.

Solutions (in arbitrary order):
- Removing these options shouldn't hurt the generated binary. I put it
  in to catch too large inline functions.
- remove the "if (ptr)" safety net from the macro and push that
  responsibility to the caller.
  Personally I'm not a great fan of the "the code checks for NULL and
  fail gracefully silent" as it makes the code explode without cause.
  But I think I know why it's in there.
- Make the number "50" larger.

The rest are trivial to fix I assume.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




