Re: BUG #1741: %i missing in snprintf implementation - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1741: %i missing in snprintf implementation
Date
Msg-id 21934.1120167316@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1741: %i missing in snprintf implementation  ("Tim Mauch" <tgmauch@yahoo.com>)
Responses Re: BUG #1741: %i missing in snprintf implementation
List pgsql-bugs
"Tim Mauch" <tgmauch@yahoo.com> writes:
> The implementation of snprintf/vsnprintf in src/port/snprintf.c does not
> allow the use of %i ( %d equivalent ).  This likely isn't a problem for
> postgres itself, but when a program compiles with -lpq and the standard c
> libraries are not previously included the use of %i in the format string of
> snprintf causes segmentation faults.
> This is easily fixed by adding "case 'i':" to the same block of code handled
> by "case 'd':" and case 'D':" in the implementation.

We are certainly not going to buy into the assumption that our snprintf
has to support every odd feature that anyone anywhere thinks snprintf
should have :-(.  The correct response to this is to figure out how your
program's calls got linked to our snprintf, and stop that from
happening.

AFAICS, our library should be defining the global symbol pg_snprintf not
snprintf.  Can you look into why that's not happening for you?

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Tim Mauch"
Date:
Subject: BUG #1741: %i missing in snprintf implementation
Next
From:
Date:
Subject: server restart when connections thread over 155 in PostgreSQL 8.03