public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* problems with ctime_r
@ 2000-12-21 11:27 Ed Barker
  2000-12-22  0:11 ` magza
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Barker @ 2000-12-21 11:27 UTC (permalink / raw)
  To: pthreads-win32

I just downloaded the latest version of pthreads-win32, and I am now
getting errors.

Most of the errors were due to redefinitions of symbols defined in winsock.
 I was able to work around this by making sure I included winsock before
pthread.h.

However, I am still getting errors when trying to call the function
ctime_r.  My old code used to work, so I diffed the old and new versions of
pthread.h

The old version was:

#define ctime_r( _clock, _buf, _len ) \
	( strncpy( (_buf), ctime( (_clock) ), (_len) ), \
	  (_buf) )


The new version is:

#define ctime_r( _clock, _buf ) \
	( strcpy( (_buf), ctime( (_tm) ) ),  \
          (_buf) )


It appears there was some sort of mixup with this function, because the
macro is using an undefined variable _tm.  Further, it is providing 3
arguments to strcpy, which only wants 2.

Am I going crazy here, or is this a bug?

Ed


Ed Barker
Signet Computers Inc.
1901 N Moore St.  Suite 805
Arlington, Va 22209
703-812-8585 (phone)
www.sigcomp.com
barkeref@sigcomp.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problems with ctime_r
  2000-12-21 11:27 problems with ctime_r Ed Barker
@ 2000-12-22  0:11 ` magza
  0 siblings, 0 replies; 2+ messages in thread
From: magza @ 2000-12-22  0:11 UTC (permalink / raw)
  To: pthreads-win32, Ed Barker

It is a bug and I have reported this my self in an older version of
pthreads-win32 and apparantly it's back again.

Regards Magnus Zakrisson


----- Original Message -----
From: "Ed Barker" <barkeref@sigcomp.com>
To: <pthreads-win32@sourceware.cygnus.com>
Sent: Thursday, December 21, 2000 8:27 PM
Subject: problems with ctime_r


> I just downloaded the latest version of pthreads-win32, and I am now
> getting errors.
>
> Most of the errors were due to redefinitions of symbols defined in
winsock.
>  I was able to work around this by making sure I included winsock before
> pthread.h.
>
> However, I am still getting errors when trying to call the function
> ctime_r.  My old code used to work, so I diffed the old and new versions
of
> pthread.h
>
> The old version was:
>
> #define ctime_r( _clock, _buf, _len ) \
> ( strncpy( (_buf), ctime( (_clock) ), (_len) ), \
>   (_buf) )
>
>
> The new version is:
>
> #define ctime_r( _clock, _buf ) \
> ( strcpy( (_buf), ctime( (_tm) ) ),  \
>           (_buf) )
>
>
> It appears there was some sort of mixup with this function, because the
> macro is using an undefined variable _tm.  Further, it is providing 3
> arguments to strcpy, which only wants 2.
>
> Am I going crazy here, or is this a bug?
>
> Ed
>
>
> Ed Barker
> Signet Computers Inc.
> 1901 N Moore St.  Suite 805
> Arlington, Va 22209
> 703-812-8585 (phone)
> www.sigcomp.com
> barkeref@sigcomp.com
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-12-22  0:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-21 11:27 problems with ctime_r Ed Barker
2000-12-22  0:11 ` magza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).