[gccsdk] libscl valist functions and __GNUC__

Nick Burrett nick at sqrt.co.uk
Thu May 24 01:14:32 PDT 2007

On 5/24/07, John-Mark Bell <jmb202 at ecs.soton.ac.uk> wrote:
> Hi,
> I've had a report from Rob Kendrick of link failures when using GCC +
> libscl + stdio valist functions.
> When __GNUC__ is defined when building code against libscl, the likes of
> vsscanf get macro-expanded to __gcc_vsscanf. I can see nowhere within the
> libscl sources where these symbols are defined. I presume the reason for
> their existence is differing valist formats between Norcroft and GCC.
> Does anyone have any idea what's actually happening here (or, indeed, if
> these functions ever actually worked with GCC + libscl)?

The macros were defined in stdio.h.  I wrote them because Norcroft did
an extra level of indirection when passing the vararg pointer to the
function.  We needed to emulate this within GCC in order to get
vsscanf() and friends working.  Certainly this used to work, as I
tested it when I originally wrote the macros.

The va_list formats are the same, as this is defined by the APCS.  It
is just the passing of the va_list to the function that is different

You'd need to undefine the macros and actually compare the assembler
output between Norcroft and GCC here to see what I'm talking about.

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.



More information about the gcc mailing list