[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: c program : pb with Sparc ?



On Sat, Jan 22, 2000 at 03:12:06AM -0500, Branden Robinson wrote:
> On Sat, Jan 22, 2000 at 01:00:19AM -0700, Jason Gunthorpe wrote:
> > 
> > On Sat, 22 Jan 2000, Branden Robinson wrote:
> > 
> > > On Fri, Jan 21, 2000 at 06:39:21PM +0100, Thierry Laronde wrote:
> > > > > strftime(NULL, size_format, strftime_format, local_time))== 0) {
                   ^^^^
> > > > the problem is here : this is a "GNUism", this is not POSIX defined. So the
> > > > problem is not on Sparc, or SunOS, but on the POSIX compliance. 
> > > > This is corrected and this works absolutely fine :)
> >  
> > > What?  strftime is defined in POSIX.1.
> > 
> > And POSIX doesn't say you can pass NULL into the first parameter and have
> > it allocate on the fly form you. 
> 
> Ah, his tabs are making his carets come up in different places depending on
> the level of quoting.

Sorry, I didn't think about the tabs...

By the way, can someone tell me before I send a bug report to the upstream
author, if in an newer version of libc draft (I'm still on slink, and the 
version is 0.07) the definition of strftime() is corrected, because, if I 
understand correctly the text, the draft says that strftime() returns the 
number of chars written, even if there was not enough place in the buffer, 
and that's wrong : POSIX.1 defines that in this case the funcion returns 0, 
which is actually the case.

TIA
-- 
Thierry LARONDE
thierry.laronde@polynum.com
website : http://www.polynum.com


Reply to: