Am 20. Apr 2006 um 11:19 CEST schrieb Christian Maeder:
Volker Stolz wrote:
Without the 3rd arg is according to POSIX (check your Solaris man page). 'buf' is required to be at least 26 bytes.
You're right, but it does not compile without the 3rd argument! Maybe this is due to gcc_4.0.3_s10 ? Should one simply rely on ctime?
Now I'm confused...or is the patch reverted? It said: #if HAVE_CTIME_R - ctime_r(&now, nowstr, 26); + ctime_r(&now, nowstr); #else This has got nothing to do with GCC, it's only related to system headers. Quoth SunOS 5.9: SYNOPSIS #include <time.h> char *ctime_r(const time_t *clock, char *buf, int buflen); ... POSIX cc [ flag... ] file... -D_POSIX_PTHREAD_SEMANTICS [ library... ] char *ctime_r(const time_t *clock, char *buf);
From my understanding of the patch above (*removing* the 3rd arg), I assumed that -D_POSIX_PTHREAD_SEMANTICS was set. It should probably be set like somewhere else (in libraries/bases/cbits/dirUtils.c), but I strongly suggest not doing this in the same (ie. through #define), but rather indeed setting it as a compiler flag. Otherwise, one of those days we'll get bitten by compiling something with skewed headers. Due to the plethora of variables in rts/Makefile, I'm a bit at a loss where to stick this in. -- Volker Stolz * http://www-i2.informatik.rwth-aachen.de/stolz/ * PGP * S/MIME