lua-users home
lua-l archive

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


On Wed, Oct 04, 2006 at 04:29:15PM -0700, Sam Roberts wrote:
> I have no idea if/when it became useful :-), it wasn't originally meant
> to be:
> 
>   This option is not intended to be useful; it exists only to satisfy
>   pedants who would otherwise claim that GCC fails to support the ANSI
>   standard.

I think it could be useful, for code that wants to be as portable as
possible (eg. Lua's core), but not a flag that should be enabled by
distributed build systems by default.

As a curiosity, the 4.1 documentation for -pedantic includes:

"GCC always tries to compile your program if possible; it never
gratuitously rejects a program whose meaning is clear merely because
(for instance) it fails to conform to a standard."

which seems like a terrible, broken philosophy for designing a compiler.
Fortuantely, most of the compiler doesn't seem to adhere to this silly
"accept anything if we can figure it out" notion, and actually aims
to be a C compiler rather than a "fuzzy C do-what-you-mean, standards-
be-damned" compiler ...

> % grep CLK_TCK /usr/include/bits/time.h
> #   define CLK_TCK ((__clock_t) __sysconf (2))  /* 2 is _SC_CLK_TCK */
> 
> CLK_TCK has been around a while, I don't think linux is going to break
> all that old software even if it isn't pedantically correct.

Looks like a simple hack, but one that should be phased out in newer
software.  It seems like using the sysconf interface really is the
right thing to be doing, in any actively-maintained code--not critical,
but not an update I'd I'd expect to see much friction against.

-- 
Glenn Maynard