Re: snprintf causes regression tests to fail - Mailing list pgsql-hackers

From pgsql@mohawksoft.com
Subject Re: snprintf causes regression tests to fail
Date
Msg-id 16751.24.91.171.78.1109765377.squirrel@mail.mohawksoft.com
Whole thread Raw
In response to Re: snprintf causes regression tests to fail  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
>
> The big question is why our own vsnprintf() is not being called from
> snprintf() in our port file.
>

I have seen this "problem" before, well, it isn't really a problem I guess.

I'm not sure of the gcc compiler options, but....

On the Microsoft compiler if you specify the option "/Gy" it separates the
functions within the object file, that way you don't load all the
functions from the object if they are not needed.

If, however, you create a function with the same name as another function,
and one is declared in an object compiled with the "/Gy" option, and the
other's object file is not, then if you also use a different function or
reference variable in the object file compiled without the "/Gy" option,
then the conflicting function will probably be used. Make sense?

I would suggest using macro to redefine snprintf and vnsprintf to avoid
the issue:

#define snprintf pg_snprintf
#define vnsprintf pg_vnsprintf



pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: Development Plans
Next
From: Mark Wong
Date:
Subject: Re: 8.0.X and the ARC patent