[gccsdk] libscl valist functions and __GNUC__

John Tytgat John.Tytgat at aaug.net
Sun May 27 12:24:58 PDT 2007


In message <ab4886070705271023w29ea19bnc883b83db6b1f295 at mail.gmail.com>
          "Nick Burrett" <nick at sqrt.co.uk> wrote:

> On 5/27/07, John Tytgat <John.Tytgat at aaug.net> wrote:
> > In message <ab4886070705240114x504a48c5n6246182299847ab5 at mail.gmail.com>
> >           "Nick Burrett" <nick at sqrt.co.uk> wrote:
> >
> > > It is just the passing of the va_list to the function that is different
> > > here.
> >
> > I don't see in our libscl code a different treatment of va_list passing
> > between GCC and Norcroft.
> 
> In stdio.h, we have macro definitions like this:
> 
> #define vsnprintf(__s,__limit,__fmt,__ap) \
>         (__gcc_vsnprintf(__s,__limit,__fmt, &__ap))
                                              ^

Ugh, missed that character completely. :-(

> > > Note that the use of macros here would suggest that linking with GCC
> > > compiled code against any Norcroft library that uses the va_list arg,
> > > would result in problems.
> >
> > r2 (admin): Added __gcc_vprintf, __gcc_vfprintf and __gcc_vsprintf as
> >   aliases for vprintf, vfprintf and vsprintf.
> > r878 (nick): Added the __gcc_* macros in stdio.h
> > r1639 (alex): Added __gcc_vsnprintf as alias for vsnprintf.
> > r2637 (joty): Added __gcc_vfscanf, __gcc_vscanf and __gcc_vsscanf as
> >   aliases for vfscanf, vscanf and vsscanf.
> >
> > I'm not sure if my change r2637 made today is the best one. I would be
> > tempted to remove the __gcc_*() macros and the resulting changes made in
> > r2, r1639 and r2637.
> 
> This is quite easy to test.  Just write a simple program that calls
> vprintf(), remove the macros and see what happens when you link
> against the SCL.

Yeah, no need for that.  I'm already convinced.  So all above changes are
the right ones.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven




More information about the gcc mailing list