This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Re: vfnprintf and floating point.
Well, it seems gcc indeed needs to be fixed in this area to be C9x
compliant :-) At least I can't find clean way to do what I want with
current gcc :-(
Sergei.
P.S. Actually, '&t' has type 'int**' in the example, not 'T**'.
Bart Veer <bartv@cygnus.co.uk> writes:
> >>>>> "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