Re: [pgsql-hackers-win32] snprintf causes regression
От | pgsql@mohawksoft.com |
---|---|
Тема | Re: [pgsql-hackers-win32] snprintf causes regression |
Дата | |
Msg-id | 16572.24.91.171.78.1109708983.squirrel@mail.mohawksoft.com обсуждение исходный текст |
Ответ на | Re: [pgsql-hackers-win32] snprintf causes regression tests (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: [pgsql-hackers-win32] snprintf causes regression tests
|
Список | pgsql-hackers |
> Nicolai Tufar wrote: >> On Tue, 1 Mar 2005 00:55:20 -0500 (EST), Bruce Momjian >> > My next guess >> > is that Win32 isn't handling va_arg(..., long long int) properly. >> > >> >> I am trying various combination of number and types >> of parameters in my test program and everything prints fine. >> When it comes to pg, it fails :( >> >> > > template1=# select * from test where x > 1000::int8; >> > > x >> > > ------------ >> > > -869367531 >> > > (1 row) >> >> I am not too fluent in source code, could someone >> point me to there actual call to snprintf() is being done >> when a query like this is executed. I could not find it myslef > > Sure, in src/backend/utils/adt/int8.c, there is a call in int8out(): > > if ((len = snprintf(buf, MAXINT8LEN, INT64_FORMAT, val)) < 0) > > and that calls port/snprintf.c. > > I have added a puts() in snprintf.c to make sure it is getting the > long/long specifier. Just a question, and don't mind me if I am being rude, isn't this the WRONG PLACE for a "printf" function? Wouldn't an "itoa" function be more efficient and be less problematic?
В списке pgsql-hackers по дате отправления: