lua-users home
lua-l archive

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


On Wed, Oct 04, 2006 at 11:28:52AM -0700, David Haley wrote:
> > lposix.c requires POSIX features, so specifying "-ansi" to gcc
> > isn't a great idea.
> >   
> 
> Actually, no; I was using LHF's Makefile which uses these arguments for
> compilation:
> 
> gcc -fPIC -I/usr/local/lua-5.0.2/include -pedantic -Wall -O2 -c -o
> lposix.o lposix.c

Try without -pedantic. The only purpose of -pedantic is to make some
code NOT compile, and you want lposix.c to compile.

It looks like gcc 4.1 causes even more so-called extensions to be
disabled by -pedantic than used to be disabled.

> It seems, in any case, that instead of defining CLK_TCK to be
> CLOCKS_PER_SEC (which is what time.h seems to do?), the correct thing to
> do would be to use sysconf(_SC_CLK_TCK) instead, right?

Maybe.

POSIX believes the system clock tick rate is not necessarily constant -
perhaps even configurable during boot or run-time. In that case it
shouldn't be a define, so they "deprecated" the traditional unix define.

Linux has had a 10ms tick rate for a long time. Do you want to delve
into the arcane depths of evolving unix APIs, or compile lposix.c? :-)

Cheers,
Sam