FreeBSD/contrib/gcc/c-decl.c
/* Subroutine of store_parm_decls which handles new-style function
   definitions (prototype format). The parms already have decls, so we
   need only record them as in effect and complain if any redundant
   old-style parm decls were written.  */
Subroutine of store_parm_decls which handles new-style function
definitions (prototype format). The parms already have decls, so we
need only record them as in effect and complain if any redundant
old-style parm decls were written.
Subroutine of store_parm_decls which handles new - style function definitions ( prototype format ) . The parms already have decls so we need only record them as in effect and complain if any redundant old - style parm decls were written .
static void
store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
{
  tree decl;
  if (current_scope->bindings)
    {
      error ("%Jold-style parameter declarations in prototyped "
	     "function definition", fndecl);
      pop_scope ();
      push_scope ();
    }
  else if (!in_system_header && !current_function_scope
	   && arg_info->types != error_mark_node)
    warning (OPT_Wtraditional,
	     "%Jtraditional C rejects ISO C style function definitions",
	     fndecl);
  for (decl = arg_info->parms; decl; decl = TREE_CHAIN (decl))
    {
      DECL_CONTEXT (decl) = current_function_decl;
      if (DECL_NAME (decl))
	{
	  bind (DECL_NAME (decl), decl, current_scope,
		false, false);
	  if (!TREE_USED (decl))
	    warn_if_shadowing (decl);
	}
      else
	error ("%Jparameter name omitted", decl);
    }
  DECL_ARGUMENTS (fndecl) = arg_info->parms;
  for (decl = arg_info->others; decl; decl = TREE_CHAIN (decl))
    {
      DECL_CONTEXT (decl) = current_function_decl;
      if (DECL_NAME (decl))
	bind (DECL_NAME (decl), decl, current_scope,
	      false, false);
    }
  for (decl = arg_info->tags; decl; decl = TREE_CHAIN (decl))
    if (TREE_PURPOSE (decl))
      bind (TREE_PURPOSE (decl), TREE_VALUE (decl), current_scope,
	    false, false);
}
static void store_parm_decls_newstyle ( tree fndecl , const struct c_arg_info * arg_info ) { tree decl ; if ( current_scope -> bindings ) { error ( " " " " , fndecl ) ; pop_scope ( ) ; push_scope ( ) ; } else if ( ! in_system_header && ! current_function_scope && arg_info -> types != error_mark_node ) warning ( OPT_Wtraditional , " " , fndecl ) ; for ( decl = arg_info -> parms ; decl ; decl = TREE_CHAIN ( decl ) ) { DECL_CONTEXT ( decl ) = current_function_decl ; if ( DECL_NAME ( decl ) ) { bind ( DECL_NAME ( decl ) , decl , current_scope , false , false ) ; if ( ! TREE_USED ( decl ) ) warn_if_shadowing ( decl ) ; } else error ( " " , decl ) ; } DECL_ARGUMENTS ( fndecl ) = arg_info -> parms ; for ( decl = arg_info -> others ; decl ; decl = TREE_CHAIN ( decl ) ) { DECL_CONTEXT ( decl ) = current_function_decl ; if ( DECL_NAME ( decl ) ) bind ( DECL_NAME ( decl ) , decl , current_scope , false , false ) ; } for ( decl = arg_info -> tags ; decl ; decl = TREE_CHAIN ( decl ) ) if ( TREE_PURPOSE ( decl ) ) bind ( TREE_PURPOSE ( decl ) , TREE_VALUE ( decl ) , current_scope , false , false ) ; }
Subroutine of store_parm_decls which handles new-style function
definitions (prototype format).
Subroutine of store_parm_decls which handles new - style function definitions ( prototype format ) .
/* Get rid of the old-style declarations.  */ /* Don't issue this warning for nested functions, and don't issue this
     warning if we got here because ARG_INFO_TYPES was error_mark_node
     (this happens when a function definition has just an ellipsis in
     its parameter list).  */ /* Now make all the parameter declarations visible in the function body.
     We can bypass most of the grunt work of pushdecl.  */ /*invisible=*/ /*nested=*/ /* Record the parameter list in the function declaration.  */ /* Now make all the ancillary declarations visible, likewise.  */ /*invisible=*/ /*nested=*/ /* And all the tag declarations.  */ /*invisible=*/ /*nested=*/