Thread: Results of port of Sept 18 port of PostgreSQL
At this point the Irix port is nearly complete. There are two problems that remain. First, the snprintf function does not process the %lld format correctly. Frankly, there is no reason to use it in src/backend/utils/adt/int8.c because there is not chance of exceeding the supplied buffer. sprintf is safe in this circumstance and works correctly. Second, the SGI C++ compiler does not recognize #include <string>, and it fails. I still have to run a multiprocess test of the new locking code, and will let you know the results when I have them. Overall, PostgreSQL is looking good! +------------------------------------------+------------------------------+ | Robert E. Bruccoleri, Ph.D. | Associate Research Professor | | President | Center for Advanced | | Congenomics, Inc. | Biotechnology and Medicine | | P.O. Box 314 | Rutgers University | | Pennington, NJ 08534 | 679 Hoes Lane | | Phone: 609 737 6383 | Piscataway, NJ 08854-5638 | +------------------------------------------+ phone: 732 235 5796 | | email: bruc@acm.org | Fax: 732 235 4850 | | URL: http://www.cabm.rutgers.edu/~bruc | | +------------------------------------------+------------------------------+
> At this point the Irix port is nearly complete. There are two problems > that remain. > > First, the snprintf function does not process the %lld format > correctly. Frankly, there is no reason to use it in > src/backend/utils/adt/int8.c because there is not chance of exceeding > the supplied buffer. sprintf is safe in this circumstance and works > correctly. Are you talking about the Irix snprintf, our our ports/snprintf.c? > > Second, the SGI C++ compiler does not recognize #include <string>, > and it fails. Where is this? > > I still have to run a multiprocess test of the new locking code, > and will let you know the results when I have them. > > Overall, PostgreSQL is looking good! -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 http://www.op.net/~candle | (610) 353-9879(w) + If your life is a hard drive, | (610) 853-3000(h) + Christ can be your backup. |
> Dear Bruce, > > > > > > At this point the Irix port is nearly complete. There are two problems > > > that remain. > > > > > > First, the snprintf function does not process the %lld format > > > correctly. Frankly, there is no reason to use it in > > > src/backend/utils/adt/int8.c because there is not chance of exceeding > > > the supplied buffer. sprintf is safe in this circumstance and works > > > correctly. > > > > Are you talking about the Irix snprintf, our our ports/snprintf.c? > > Irix doesn't have snprintf, so I'm talking about your ports. They > are missing %lld formats. OK, we need our ports snprintf() to understand %lld. Marc? -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 http://www.op.net/~candle | (610) 353-9879(w) + If your life is a hard drive, | (610) 853-3000(h) + Christ can be your backup. |
On Tue, 22 Sep 1998, Bruce Momjian wrote: > > Irix doesn't have snprintf, so I'm talking about your ports. They > > are missing %lld formats. > > OK, we need our ports snprintf() to understand %lld. Marc? Ack...I just borrowed what was in sendmail...are you saying that sendmail doesn't work under Irix either? :( Ah, okay, just looking at the source code itself...neat, I think :) How does this look? '%lld == long long', correct? *** snprintf.c.orig Tue Sep 22 22:41:46 1998 --- snprintf.c Tue Sep 22 22:44:26 1998 *************** *** 126,131 **** --- 126,132 ---- int ch; long value; int longflag = 0; + int longlongflag = 0; int pointflag = 0; int maxwidth = 0; char *strvalue; *************** *** 167,173 **** len = va_arg( args, int ); goto nextch; case '.': pointflag = 1; goto nextch; ! case 'l': longflag = 1; goto nextch; case 'u': case 'U': /*fmtnum(value,base,dosign,ljust,len,zpad) */ if( longflag ){ --- 168,178 ---- len = va_arg( args, int ); goto nextch; case '.': pointflag = 1; goto nextch; ! case 'l': if(longflag) { ! longlongflag = 1; goto nextch; ! } else { ! longflag = 1; goto nextch; ! } case 'u': case 'U': /*fmtnum(value,base,dosign,ljust,len,zpad) */ if( longflag ){ *************** *** 186,192 **** --- 191,201 ---- fmtnum( value, 8,0, ljust, len, zpad ); break; case 'd': case 'D': if( longflag ){ + if( longlongflag ) { + value = va_arg( args, long long ); + } else { value = va_arg( args, long ); + } } else { value = va_arg( args, int ); }
> On Tue, 22 Sep 1998, Bruce Momjian wrote: > > > > Irix doesn't have snprintf, so I'm talking about your ports. They > > > are missing %lld formats. > > > > OK, we need our ports snprintf() to understand %lld. Marc? > > Ack...I just borrowed what was in sendmail...are you saying that > sendmail doesn't work under Irix either? :( Not for long long's, no. > > Ah, okay, just looking at the source code itself...neat, I think > :) How does this look? '%lld == long long', correct? Yes. Sure, throw it in and let him test it. > > *** snprintf.c.orig Tue Sep 22 22:41:46 1998 > --- snprintf.c Tue Sep 22 22:44:26 1998 > *************** > *** 126,131 **** > --- 126,132 ---- > int ch; > long value; > int longflag = 0; > + int longlongflag = 0; > int pointflag = 0; > int maxwidth = 0; > char *strvalue; > *************** > *** 167,173 **** > len = va_arg( args, int ); > goto nextch; > case '.': pointflag = 1; goto nextch; > ! case 'l': longflag = 1; goto nextch; > case 'u': case 'U': > /*fmtnum(value,base,dosign,ljust,len,zpad) */ > if( longflag ){ > --- 168,178 ---- > len = va_arg( args, int ); > goto nextch; > case '.': pointflag = 1; goto nextch; > ! case 'l': if(longflag) { > ! longlongflag = 1; goto nextch; > ! } else { > ! longflag = 1; goto nextch; > ! } > case 'u': case 'U': > /*fmtnum(value,base,dosign,ljust,len,zpad) */ > if( longflag ){ > *************** > *** 186,192 **** > --- 191,201 ---- > fmtnum( value, 8,0, ljust, len, zpad ); break; > case 'd': case 'D': > if( longflag ){ > + if( longlongflag ) { > + value = va_arg( args, long long ); > + } else { > value = va_arg( args, long ); > + } > } else { > value = va_arg( args, int ); > } > > -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 http://www.op.net/~candle | (610) 353-9879(w) + If your life is a hard drive, | (610) 853-3000(h) + Christ can be your backup. |
On Tue, 22 Sep 1998, Bruce Momjian wrote: > > Ah, okay, just looking at the source code itself...neat, I think > > :) How does this look? '%lld == long long', correct? > > Yes. > > Sure, throw it in and let him test it. Done... Marc G. Fournier Systems Administrator @ hub.org primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
> long value; > + value = va_arg( args, > long long ); Um, no. Try "long long value;" JP Sugarbroad