Branch: Tag:

2002-04-26

2002-04-26 17:11:16 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added check for local functions with missing definitions.
Fixes [bug 2991 (#2991)].

Rev: src/program.c:1.417

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.416 2002/04/26 16:51:03 grubba Exp $"); + RCSID("$Id: program.c,v 1.417 2002/04/26 17:11:16 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
1259:    struct identifier *fun;    funp=p->identifier_references+i;    if(funp->id_flags & (ID_HIDDEN|ID_STATIC)) continue; +  fun=ID_FROM_PTR(p, funp);    if(funp->id_flags & ID_INHERITED)    {    int found_better=-1;    int funa_is_prototype;       if(funp->id_flags & ID_PRIVATE) continue; -  fun=ID_FROM_PTR(p, funp); +     funa_is_prototype = fun->func.offset == -1;   /* if(fun->func.offset == -1) continue; * prototype */   
1303:    if(found_better!=-1)    continue;    } +  if ((fun->func.offset == -1) && (funp->id_flags & ID_INLINE) && +  IDENTIFIER_IS_PIKE_FUNCTION(fun->identifier_flags)) { +  if (!fun->name->size_shift && fun->name->len < 900) { +  my_yyerror("Missing definition for local function %s().", +  fun->name->str); +  } else { +  yyerror("Missing definition for local function."); +  } +  }    add_to_identifier_index(i);    }    fsort((void *)p->identifier_index,