This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3/mainline;libiberty] Fix vasprintf.c


> > I do not exactly wky but Honza told me that "&args" where args is
> > va_list is not defined anyway.
> 
> Perhaps it is a macro?
> 
> On some operating systems va_list is a struct,
> on others it is a pointer to an argument list.
> You said that the problem was related to it
> being an ARRAY instead of a pointer, that confused
> me before - and now I get the feeling this particular
> case hasn't been investigated until it was understood
> fully - are you sure it is an array? (ie, typedef int va_list[MAX_ARGS]).

According to GCC sources( gcc/config/i386/i386.c:ix86_build_va_list),
it seems to be an one element array, the element is something like
struct {
unsigned gp_offset;
unsigned fp_offset;
void *overflow_arg_area;
void *reg_save_area;
}

> If you'd give the preprocessed source for that target,
> then we can see the real definition of va_list and
> hopefully understand this better.

Preprocessed source still contains "va_list",
shortened preprocessed source:

typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
int
vasprintf (result, format, args)
     char **result;
     const char *format;
     va_list args;

{
  return int_vasprintf (result, format, args);
}

Josef


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]