This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: vfnprintf and floating point.
>>>>> "Sergei" == Sergei Organov <osv@Javad.RU> writes:
Sergei> I'm aware of this statement in C standard. That's why I
Sergei> tried to pass 'va_list*', not 'va_list' to the cvt().
Sergei> Unfortunately in PowerPC va_list declared like 'typedef
Sergei> _tag struct {...} va_list[1];'. This causes troubles.
Sergei> Consider:
Sergei> typedef int Type[1];
Sergei> void boo(Type* ptype);
Sergei> void foo(Type t)
Sergei> {
Sergei> boo(&t); // Trouble here: &t has type 'T**', and 'boo' needs
Sergei> // type 'int (*)[1]'.
Sergei> }
Sergei> Just now I don't see how to avoid this.
OK, I have done some more checking. The 1989 standard does not go into
further detail on this, so it is debatable whether or not passing a
va_list via a pointer rather than by value is legal. According to a
draft of the C9x standard it is legal to pass a pointer to a va_list
to another function things should work as you expect. The C++ standard
does not address the issue directly, it just references the C
standard. This is one of the areas that will have to be addressed as
gcc moves to C9x compliance, but it may take a while before anything
happens.
Bart Veer // eCos net maintainer