[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compiling lposix.c (patch)
- From: David Jones <drj@...>
- Date: Fri, 6 Oct 2006 08:52:43 +0100
On 5 Oct 2006, at 21:51, Sam Roberts wrote:
On Thu, Oct 05, 2006 at 08:32:31PM +0100, David Jones wrote:
And more importantly, nobody has posted here that *it doesn't work*.
It doesn't work! On OS X 10.4.
Maybe using sysconf() if _SC_CLK_TCK is defined is a good way to go,
then, falling back on CLK_TCK otherwise?
I just added:
#undef CLK_TCK
#define CLK_TCK (sysconf(_SC_CLK_TCK))
and it compiles just fine. On OS X 10.4 CLK_TCK doesn't work with or
without -pedantic btw. And sysconf works with or without it
(slightly to my surprise).
I'd be loath to clutter the code with #ifdefs. Better to use the
sysconf interface and see how many people complain. It says here
(the sysconf man page on OS X) that sysconf was defined in 1988,
_surely_ 18 years is long enough for most OSes to have got round to
implementing it (see also C99 discussion :) ). But I'm sure LHF has
an opinion on that too.
Oh dear. Umm. I take it all back.
I've now looked at how lposix _uses_ CLK_TCK. It's used to
manipulate the results of the times(3) call. Which, in OS X, is
documented as A) obsoleted and B) returning values in CLK_TCK's of a
second. But sadly, as I've discovered, CLK_TCK isn't defined on OS X
10.4 so that makes times(3) completely useless.
Will try when I get home, but I haven't paid the apple tax yet, I'm
still at OS X 10.3. I hope you weren't using -pedantic to knee-cap
otherwise working code. :-)
No, the only reason I was playing around with lposix.c was because of
the discussion here on the list.
I'm a great fan of -ansi -pedantic -Wall though.
drj
- References:
- Compiling lposix.c (patch), David Haley
- Re: Compiling lposix.c (patch), Sam Roberts
- Re: Compiling lposix.c (patch), David Haley
- Re: Compiling lposix.c (patch), Sam Roberts
- Re: Compiling lposix.c (patch), Glenn Maynard
- Re: Compiling lposix.c (patch), Sam Roberts
- Re: Compiling lposix.c (patch), Glenn Maynard
- Re: Compiling lposix.c (patch), David Jones
- Re: Compiling lposix.c (patch), Sam Roberts
- Re: Compiling lposix.c (patch), David Jones
- Re: Compiling lposix.c (patch), Sam Roberts